Skip to content

Commit

Permalink
Pivotal importer: ensure stories that have multiple owners get assign…
Browse files Browse the repository at this point in the history
…ed as multiple assignees in Taiga
  • Loading branch information
mig5 committed Nov 20, 2024
1 parent ef63894 commit 27d90b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions taiga/importers/pivotal/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,13 @@ def _import_user_stories_data(self, project_data, project, options):
tags.append(label['name'])

assigned_to = None
assigned_users = []
if len(story['owner_ids']) > 0:
assigned_to = users_bindings.get(story['owner_ids'][0], None)
for assignee in story['owner_ids']:
bound_user = users_bindings.get(assignee, None)
if bound_user:
assigned_users.append(bound_user.id)

owner = users_bindings.get(story['requested_by_id'], self._user)

Expand All @@ -382,6 +387,9 @@ def _import_user_stories_data(self, project_data, project, options):
milestone=story_milestone_binding.get(story['id'], None)
)

if assigned_users:
us.assigned_users.set(assigned_users)

points = Points.objects.get(project=project, value=story.get('estimate', None))
RolePoints.objects.filter(user_story=us, role__slug="main").update(points_id=points.id)

Expand Down

0 comments on commit 27d90b5

Please sign in to comment.