Skip to content

Commit

Permalink
Fixed a bug that would overwrite the id of an issue type if there is …
Browse files Browse the repository at this point in the history
…one standard issue defined locally and more than one in the remote (#184)
  • Loading branch information
Jake151 authored Mar 11, 2024
1 parent c531c11 commit 5ce4897
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tenable_jira/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ def __init__(self, src, jira, config):
# with that jira_id.
if itype['type'] == 'standard':
for item in itypes:
if not item['subtask']:
# Check if the name of the remote and config issue types match
# before the ID is changed.
if itype['name'] == item['name']:
self.task = {
'name': itype['name'],
'jira_id': int(item['id']),
'jira_id': int(itype.get('jira_id', item['id'])),
'type': itype['type'],
'search': itype['search']
}
Expand All @@ -54,10 +56,12 @@ def __init__(self, src, jira, config):
# with that jira_id.
elif itype['type'] == 'subtask':
for item in itypes:
if item['subtask']:
# Check if the name of the remote and config issue types match
# before the ID is changed.
if itype['name'] == item['name']:
self.subtask = {
'name': itype['name'],
'jira_id': int(item['id']),
'jira_id': int(itype.get('jira_id', item['id'])),
'type': itype['type'],
'search': itype['search']
}
Expand Down

0 comments on commit 5ce4897

Please sign in to comment.