-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
When closing findings that have been pushed to Jira via the Web UI the Jira finding automatically closes but when closing a finding via the api the connected Jira finding does not get closed in Jira.
Running DD 2.50.2 in Docker on Ubuntu 22.04
The difference is in the views.py:
django-DefectDojo/dojo/api_v2/views.py
Line 965 in 68821a8
finding.save() |
django-DefectDojo/dojo/finding/views.py
Lines 1183 to 1199 in 68821a8
push_to_jira = False | |
# Determine if the finding is in a group. if so, not push to jira | |
finding_in_group = finding.has_finding_group | |
# Check if there is a jira issue that needs to be updated | |
jira_issue_exists = finding.has_jira_issue or (finding.finding_group and finding.finding_group.has_jira_issue) | |
# fetch the project | |
jira_instance = jira_helper.get_jira_instance(finding) | |
jira_project = jira_helper.get_jira_project(finding) | |
# Only push if the finding is not in a group | |
if jira_issue_exists: | |
# Determine if any automatic sync should occur | |
push_to_jira = jira_helper.is_push_all_issues(finding) or jira_instance.finding_jira_sync | |
# Add the closing note | |
if (jira_project.push_notes or push_to_jira) and not finding_in_group: | |
jira_helper.add_comment(finding, new_note, force_push=True) | |
# Save the finding | |
finding.save(push_to_jira=(push_to_jira and not finding_in_group)) |