Skip to content

Finding not being closed in Jira when closed via the API #13215

@eric-warren

Description

@eric-warren

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:

finding.save()

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions