diff --git a/tenable_jira/transform.py b/tenable_jira/transform.py index f9ced93..1426516 100644 --- a/tenable_jira/transform.py +++ b/tenable_jira/transform.py @@ -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'] } @@ -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'] }