Skip to content

Commit c817d67

Browse files
authored
Jira: Append labels and respect priority on update (DefectDojo#9571)
A couple fields are overwritten by DefectDojo when findings are pushed to an existing jira ticket. This can be destructive for developers in the following ways: - Priority: This field often reflects the timeline a particular issue may be fixed. Developers may have more specific context for why a vulnerability may not be as severe as initially thought. - Labels: Labels could be used to sort issues in a given queue to determine who works on a given ticket. When a finding is pushed to jira again after creation, these new labels should not be overwritten These fields should be respected to avoid stomping on any changes/process set by developers
1 parent f857e9f commit c817d67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dojo/jira_link/helper.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -863,17 +863,19 @@ def update_jira_issue(obj, *args, **kwargs):
863863
summary=jira_summary(obj),
864864
description=jira_description(obj),
865865
component_name=jira_project.component if not issue.fields.components else None,
866-
labels=labels,
866+
labels=labels + issue.fields.labels,
867867
environment=jira_environment(obj),
868-
priority_name=jira_priority(obj),
868+
# Do not update the priority in jira after creation as this could have changed in jira, but should not change in dojo
869+
# priority_name=jira_priority(obj),
869870
issuetype_fields=issuetype_fields)
870871

871872
logger.debug('sending fields to JIRA: %s', fields)
872873

873874
issue.update(
874875
summary=fields['summary'],
875876
description=fields['description'],
876-
priority=fields['priority'],
877+
# Do not update the priority in jira after creation as this could have changed in jira, but should not change in dojo
878+
# priority=fields['priority'],
877879
fields=fields)
878880

879881
push_status_to_jira(obj, jira_instance, jira, issue)

0 commit comments

Comments
 (0)