@@ -33,7 +33,9 @@ def expire_now(risk_acceptance):
33
33
if risk_acceptance .restart_sla_expired :
34
34
finding .sla_start_date = timezone .now ().date ()
35
35
# this method both saves and pushed to JIRA (no other post processing)
36
- jira_helper .save_and_push_to_jira (finding )
36
+ finding .save (dedupe_option = False )
37
+ if jira_helper .is_push_all_issues (finding ) or jira_helper .is_keep_in_sync_with_jira (finding ):
38
+ jira_helper .push_to_jira (finding )
37
39
38
40
reactivated_findings .append (finding )
39
41
else :
@@ -72,7 +74,9 @@ def reinstate(risk_acceptance, old_expiration_date):
72
74
# Update any endpoint statuses on each of the findings
73
75
update_endpoint_statuses (finding , accept_risk = True )
74
76
# this method both saves and pushed to JIRA (no other post processing)
75
- jira_helper .save_and_push_to_jira (finding )
77
+ finding .save (dedupe_option = False )
78
+ if jira_helper .is_push_all_issues (finding ) or jira_helper .is_keep_in_sync_with_jira (finding ):
79
+ jira_helper .push_to_jira (finding )
76
80
reinstated_findings .append (finding )
77
81
else :
78
82
logger .debug ("%i:%s: already inactive, not making any changes" , finding .id , finding )
@@ -113,7 +117,10 @@ def remove_finding_from_risk_acceptance(user: Dojo_User, risk_acceptance: Risk_A
113
117
# Update any endpoint statuses on each of the findings
114
118
update_endpoint_statuses (finding , accept_risk = False )
115
119
# this method both saves and pushed to JIRA (no other post processing)
116
- jira_helper .save_and_push_to_jira (finding )
120
+ finding .save (dedupe_option = False )
121
+ if jira_helper .is_push_all_issues (finding ) or jira_helper .is_keep_in_sync_with_jira (finding ):
122
+ jira_helper .push_to_jira (finding )
123
+
117
124
# best effort jira integration, no status changes
118
125
post_jira_comments (risk_acceptance , [finding ], unaccepted_message_creator )
119
126
# Add a note to reflect that the finding was removed from the risk acceptance
@@ -319,6 +326,9 @@ def simple_risk_accept(user: Dojo_User, finding: Finding, *, perform_save=True)
319
326
finding .save (dedupe_option = False )
320
327
# post_jira_comment might reload from database so see unaccepted finding. but the comment
321
328
# only contains some text so that's ok
329
+ if jira_helper .is_push_all_issues (finding ) or jira_helper .is_keep_in_sync_with_jira (finding ):
330
+ jira_helper .push_to_jira (finding )
331
+
322
332
post_jira_comment (finding , accepted_message_creator )
323
333
# Add a note to reflect that the finding was removed from the risk acceptance
324
334
if user is not None :
@@ -349,7 +359,8 @@ def risk_unaccept(user: Dojo_User, finding: Finding, *, perform_save=True, post_
349
359
post_jira_comment (finding , unaccepted_message_creator )
350
360
351
361
# Update the JIRA obect for this finding
352
- jira_helper .save_and_push_to_jira (finding )
362
+ if jira_helper .is_push_all_issues (finding ) or jira_helper .is_keep_in_sync_with_jira (finding ):
363
+ jira_helper .push_to_jira (finding )
353
364
354
365
# Add a note to reflect that the finding was removed from the risk acceptance
355
366
if user is not None :
0 commit comments