Skip to content

Commit e3407a4

Browse files
Expose has_any_jira_issue filter for findings (#12670) (#14266)
The `has_jira_issue` filter only checks if the finding itself has a JIRA issue. For findings in a group where the group has a JIRA issue, this filter doesn't match. A `FindingHasJIRAFilter` that checks both already existed but was never wired up to be visible in the UI or API. Rename it to `has_any_jira_issue`, add help text, and include it in `get_finding_filterset_fields()` so it appears in the finding filters when both JIRA and finding groups are enabled. Closes #12670
1 parent 1f0b204 commit e3407a4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

dojo/filters.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ def get_finding_filterset_fields(*, metrics=False, similar=False, filter_string_
518518
if get_system_setting("enable_jira"):
519519
fields.extend([
520520
"has_jira_group_issue",
521+
"has_any_jira_issue",
521522
])
522523

523524
return fields
@@ -1916,7 +1917,10 @@ def filter_endpoints(self, queryset, name, value):
19161917
lookup_expr="isnull",
19171918
exclude=True,
19181919
label="Has Group JIRA")
1919-
has_any_jira = FindingHasJIRAFilter(label="Has Any JIRA")
1920+
has_any_jira_issue = FindingHasJIRAFilter(
1921+
label="Has Any JIRA Issue",
1922+
help_text="Matches JIRA issues linked to the finding itself or to the finding's group.",
1923+
)
19201924

19211925
outside_of_sla = FindingSLAFilter(label="Outside of SLA")
19221926
has_tags = BooleanFilter(field_name="tags", lookup_expr="isnull", exclude=True, label="Has tags")

0 commit comments

Comments
 (0)