Skip to content

Commit 136dc4b

Browse files
push to jira on reinstate/expiry of Risk Acceptance
1 parent 050c5dd commit 136dc4b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

dojo/jira_link/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ def save_and_push_to_jira(finding):
17591759
push_to_jira_decision = is_push_all_issues(finding) \
17601760
or get_jira_instance(finding).finding_jira_sync
17611761
# Save the finding
1762-
finding.save(push_to_jira=(push_to_jira_decision and not finding_in_group))
1762+
finding.save(dedupe_option=False, product_grading_option=False, issue_updater_option=False, push_to_jira=(push_to_jira_decision and not finding_in_group))
17631763
# we only push the group after saving the finding to make sure
17641764
# the updated data of the finding is pushed as part of the group
17651765
if push_to_jira_decision and finding_in_group:

dojo/risk_acceptance/helper.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def expire_now(risk_acceptance):
3232

3333
if risk_acceptance.restart_sla_expired:
3434
finding.sla_start_date = timezone.now().date()
35-
36-
finding.save(dedupe_option=False)
35+
# this method both saves and pushed to JIRA (no other post processing)
36+
jira_helper.save_and_push_to_jira(finding)
3737

3838
reactivated_findings.append(finding)
3939
else:
@@ -71,7 +71,8 @@ def reinstate(risk_acceptance, old_expiration_date):
7171
finding.risk_accepted = True
7272
# Update any endpoint statuses on each of the findings
7373
update_endpoint_statuses(finding, accept_risk=True)
74-
finding.save(dedupe_option=False)
74+
# this method both saves and pushed to JIRA (no other post processing)
75+
jira_helper.save_and_push_to_jira(finding)
7576
reinstated_findings.append(finding)
7677
else:
7778
logger.debug("%i:%s: already inactive, not making any changes", finding.id, finding)
@@ -111,7 +112,8 @@ def remove_finding_from_risk_acceptance(user: Dojo_User, risk_acceptance: Risk_A
111112
finding.risk_accepted = False
112113
# Update any endpoint statuses on each of the findings
113114
update_endpoint_statuses(finding, accept_risk=False)
114-
finding.save(dedupe_option=False)
115+
# this method both saves and pushed to JIRA (no other post processing)
116+
jira_helper.save_and_push_to_jira(finding)
115117
# best effort jira integration, no status changes
116118
post_jira_comments(risk_acceptance, [finding], unaccepted_message_creator)
117119
# Add a note to reflect that the finding was removed from the risk acceptance

0 commit comments

Comments
 (0)