@@ -1674,19 +1674,24 @@ def process_resolution_from_jira(finding, resolution_id, resolution_name, assign
16741674 jira_instance = get_jira_instance (finding )
16751675
16761676 if resolved :
1677- if jira_instance and resolution_name in jira_instance .accepted_resolutions :
1677+ if jira_instance and resolution_name in jira_instance .accepted_resolutions and ( finding . test . engagement . product . enable_simple_risk_acceptance or finding . test . engagement . enable_full_risk_acceptance ) :
16781678 if not finding .risk_accepted :
1679- logger .debug (f"Marking related finding of { jira_issue .jira_key } as accepted. Creating risk acceptance." )
1679+ logger .debug (f"Marking related finding of { jira_issue .jira_key } as accepted." )
1680+ finding .risk_accepted = True
16801681 finding .active = False
16811682 finding .mitigated = None
16821683 finding .is_mitigated = False
16831684 finding .false_p = False
1684- ra = Risk_Acceptance .objects .create (
1685- accepted_by = assignee_name ,
1686- owner = finding .reporter ,
1687- )
1688- finding .test .engagement .risk_acceptance .add (ra )
1689- ra_helper .add_findings_to_risk_acceptance (User .objects .get_or_create (username = "JIRA" )[0 ], ra , [finding ])
1685+
1686+ if finding .test .engagement .product .enable_full_risk_acceptance :
1687+ logger .debug (f"Creating risk acceptance for finding linked to { jira_issue .jira_key } ." )
1688+ ra = Risk_Acceptance .objects .create (
1689+ accepted_by = assignee_name ,
1690+ owner = finding .reporter ,
1691+ decision_details = f"Risk Acceptance automatically created from JIRA issue { jira_issue .jira_key } with resolution { resolution_name } " ,
1692+ )
1693+ finding .test .engagement .risk_acceptance .add (ra )
1694+ ra_helper .add_findings_to_risk_acceptance (User .objects .get_or_create (username = "JIRA" )[0 ], ra , [finding ])
16901695 status_changed = True
16911696 elif jira_instance and resolution_name in jira_instance .false_positive_resolutions :
16921697 if not finding .false_p :
0 commit comments