Skip to content

Commit

Permalink
refactor: allow single string and WithResolution values by converting…
Browse files Browse the repository at this point in the history
… them to a tuple
  • Loading branch information
mrts committed Jan 9, 2023
1 parent 270e968 commit 1761701
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions exportimportconfig-sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
'Done': 'Done',
}

# Note that transition names are different from status names
STATUS_TRANSITIONS = {
'Open': None,
'Reopened': None,
Expand Down
4 changes: 4 additions & 0 deletions lib/export_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ def _set_status(new_issue, old_issue, conf, target_jira):
transitions = transition_map[status_name]
if not transitions:
return
# Allow single string and WithResolution values by converting them to a tuple
if isinstance(transitions, str) or isinstance(transitions, conf.WithResolution):
transitions = (transitions,)

for transition_name in transitions:
if isinstance(transition_name, conf.WithResolution):
resolution = conf.RESOLUTION_MAP[old_issue.fields.resolution.name]
Expand Down

0 comments on commit 1761701

Please sign in to comment.