@@ -102,6 +102,13 @@ def _reconcile_findings(mode, product_obj, engagement_obj, timestamp, dryrun, me
102102 resolution = issue_from_jira .fields .resolution if issue_from_jira .fields .resolution and issue_from_jira .fields .resolution != "None" else None
103103 resolution_id = resolution .id if resolution else None
104104 resolution_name = resolution .name if resolution else None
105+ # statusCategory.key is the canonical "is this issue done" signal
106+ # that process_resolution_from_jira uses to decide whether to mitigate.
107+ status_category_key = getattr (
108+ getattr (getattr (issue_from_jira .fields , "status" , None ), "statusCategory" , None ),
109+ "key" ,
110+ None ,
111+ )
105112
106113 # convert from str to datetime
107114 issue_from_jira .fields .updated = parse_datetime (issue_from_jira .fields .updated )
@@ -175,7 +182,11 @@ def _reconcile_findings(mode, product_obj, engagement_obj, timestamp, dryrun, me
175182 if action == "import_status_from_jira" :
176183 message_action = "deactivating" if find .active else "reactivating"
177184
178- status_changed = jira_helper .process_resolution_from_jira (find , resolution_id , resolution_name , assignee_name , issue_from_jira .fields .updated , find .jira_issue ) if not dryrun else "dryrun"
185+ status_changed = jira_helper .process_resolution_from_jira (
186+ find , resolution_id , resolution_name , assignee_name ,
187+ issue_from_jira .fields .updated , find .jira_issue ,
188+ status_category_key = status_category_key ,
189+ ) if not dryrun else "dryrun"
179190 if status_changed :
180191 message = f"{ find .jira_issue .jira_key } ; { settings .SITE_URL } /finding/{ find .id } ;{ find .status ()} ;{ resolution_name } ;{ flag1 } ;{ flag2 } ;{ flag3 } ;{ find .jira_issue .jira_change } ;{ issue_from_jira .fields .updated } ;{ find .last_status_update } ;{ issue_from_jira .fields .updated } ;{ find .last_reviewed } ;{ issue_from_jira .fields .updated } ;{ message_action } finding in defectdojo;{ status_changed } "
181192 messages .append (message )
@@ -264,6 +275,13 @@ def _reconcile_finding_groups(mode, product_obj, engagement_obj, timestamp, dryr
264275 resolution = issue_from_jira .fields .resolution if issue_from_jira .fields .resolution and issue_from_jira .fields .resolution != "None" else None
265276 resolution_id = resolution .id if resolution else None
266277 resolution_name = resolution .name if resolution else None
278+ # statusCategory.key is the canonical "is this issue done" signal
279+ # that process_resolution_from_jira uses to decide whether to mitigate.
280+ status_category_key = getattr (
281+ getattr (getattr (issue_from_jira .fields , "status" , None ), "statusCategory" , None ),
282+ "key" ,
283+ None ,
284+ )
267285
268286 # convert from str to datetime
269287 issue_from_jira .fields .updated = parse_datetime (issue_from_jira .fields .updated )
@@ -335,6 +353,7 @@ def _reconcile_finding_groups(mode, product_obj, engagement_obj, timestamp, dryr
335353 find , resolution_id , resolution_name , assignee_name ,
336354 issue_from_jira .fields .updated , finding_group .jira_issue ,
337355 finding_group = finding_group ,
356+ status_category_key = status_category_key ,
338357 )
339358 else :
340359 status_changed = "dryrun"
0 commit comments