Skip to content

Commit 0a93aa6

Browse files
authored
Close Findings: Push notes if push notes is enabled (#10581)
1 parent 993a73a commit 0a93aa6

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

dojo/finding/views.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,17 +1272,18 @@ def close_finding(request, fid):
12721272
finding_in_group = finding.has_finding_group
12731273
# Check if there is a jira issue that needs to be updated
12741274
jira_issue_exists = finding.has_jira_issue or (finding.finding_group and finding.finding_group.has_jira_issue)
1275+
# fetch the project
1276+
jira_instance = jira_helper.get_jira_instance(finding)
1277+
jira_project = jira_helper.get_jira_project(finding)
12751278
# Only push if the finding is not in a group
12761279
if jira_issue_exists:
12771280
# Determine if any automatic sync should occur
1278-
push_to_jira = jira_helper.is_push_all_issues(finding) \
1279-
or jira_helper.get_jira_instance(finding).finding_jira_sync
1280-
# Add the closing note
1281-
if push_to_jira and not finding_in_group:
1282-
jira_helper.add_comment(finding, new_note, force_push=True)
1281+
push_to_jira = jira_helper.is_push_all_issues(finding) or jira_instance.finding_jira_sync
1282+
# Add the closing note
1283+
if (jira_project.push_notes or push_to_jira) and not finding_in_group:
1284+
jira_helper.add_comment(finding, new_note, force_push=True)
12831285
# Save the finding
12841286
finding.save(push_to_jira=(push_to_jira and not finding_in_group))
1285-
12861287
# we only push the group after saving the finding to make sure
12871288
# the updated data of the finding is pushed as part of the group
12881289
if push_to_jira and finding_in_group:

0 commit comments

Comments
 (0)