Skip to content

Commit

Permalink
Pivotal importer: Set a dummy person in comment when it is undefined.
Browse files Browse the repository at this point in the history
Fix 'scrum or scrum' helper info on jira and pivotal commands.
  • Loading branch information
mig5 committed Oct 10, 2024
1 parent 31e7706 commit c33922f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion taiga/importers/management/commands/import_from_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def add_arguments(self, parser):
parser.add_argument('--project-type', dest="project_type", type=str,
help='Project type in jira: project or board')
parser.add_argument('--template', dest='template', default="scrum",
help='template to use: scrum or scrum (default scrum)')
help='template to use: scrum or kanban (default scrum)')
parser.add_argument('--ask-for-users', dest='ask_for_users', const=True,
action="store_const", default=False,
help='Import closed data')
Expand Down
2 changes: 1 addition & 1 deletion taiga/importers/management/commands/import_from_pivotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def add_arguments(self, parser):
parser.add_argument('--project-id', dest="project_id", type=str,
help='Project ID or full name (ex: taigaio/taiga-back)')
parser.add_argument('--template', dest='template', default="scrum",
help='template to use: scrum or scrum (default scrum)')
help='template to use: scrum or kanban (default scrum)')
parser.add_argument('--ask-for-users', dest='ask_for_users', const=True,
action="store_const", default=False,
help='Import closed data')
Expand Down
5 changes: 5 additions & 0 deletions taiga/importers/pivotal/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ def _import_comments(self, project_data, obj, story, options):
users_bindings = options.get('users_bindings', {})

for comment in story['comments']:
if not comment.get('person', False):
print(f"Person element is missing in comment {comment['id']} of story {story['id']}, will treat as unknown")
comment['person'] = {}
comment['person']['id'] = '0'
comment['person']['name'] = 'unknown'
if 'text' in comment:
snapshot = take_snapshot(
obj,
Expand Down

0 comments on commit c33922f

Please sign in to comment.