From 3e0f775b84db97751faa1a4d0a7871dbaa2b0f9d Mon Sep 17 00:00:00 2001 From: svader0 Date: Wed, 26 Aug 2026 11:32:12 -0500 Subject: [PATCH] fix(jira): gate the legacy endpoints block in the classic issue templates The V3 Locations gate was added to dojo/templates/issue-trackers only. The classic copies under dojo/templates_classic/ kept the ungated `{% if finding.endpoints.all %}`, and those are the copies the loader serves: UIPreferenceLoader puts the classic tree first for every user who has not opted into the Tailwind UI. A migrated tenant keeps its legacy Endpoint rows, so rendering that block with V3_FEATURE_LOCATIONS on hydrates a deprecated Endpoint and raises NotImplementedError. Pushing such a finding to JIRA or GitHub returned a 500. Both templates now carry the same gate the Tailwind copies already have. The finding-group template gets it too, because jira_description renders that one for a group push and it had the identical block. Fixes the two pre-existing failures in unittests/test_endpoint_init_v3.TestEndpointInitV3. --- .../issue-trackers/jira_full/jira-description.tpl | 12 +++++++++++- .../jira_full/jira-finding-group-description.tpl | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dojo/templates_classic/issue-trackers/jira_full/jira-description.tpl b/dojo/templates_classic/issue-trackers/jira_full/jira-description.tpl index 610fabeae01..c919e0bcf17 100644 --- a/dojo/templates_classic/issue-trackers/jira_full/jira-description.tpl +++ b/dojo/templates_classic/issue-trackers/jira_full/jira-description.tpl @@ -43,13 +43,23 @@ *Commit hash:* {{ finding.test.engagement.commit_hash }} {% endif %} +{% if V3_FEATURE_LOCATIONS %} +{% if finding.locations.all %} +*Systems/Locations*: +||Location||Status|| +{% for location_ref in finding.locations.all %}|{{ location_ref.location }}|{{ location_ref.get_status_display }}| +{% endfor %} +{% endif %} +{% else %} +{% comment %} TODO: Delete this after the move to Locations {% endcomment %} {% if finding.endpoints.all %} *Systems/Endpoints*: ||System/Endpoint||Status|| {% for endpoint in finding|get_vulnerable_endpoints %}|{{ endpoint }}|{{ endpoint|endpoint_display_status:finding }}| {% endfor %}{% for endpoint in finding|get_mitigated_endpoints %}|{{ endpoint }}|{{ endpoint|endpoint_display_status:finding }}| {% endfor %} -{%endif%} +{% endif %} +{% endif %} {% if finding.component_name %} diff --git a/dojo/templates_classic/issue-trackers/jira_full/jira-finding-group-description.tpl b/dojo/templates_classic/issue-trackers/jira_full/jira-finding-group-description.tpl index 1d53270ff80..4fb79642fc3 100644 --- a/dojo/templates_classic/issue-trackers/jira_full/jira-finding-group-description.tpl +++ b/dojo/templates_classic/issue-trackers/jira_full/jira-finding-group-description.tpl @@ -47,13 +47,23 @@ h3. [{{ finding.title|jiraencode}}|{{ finding_url|full_url }}] {% if finding.cve %}*CVE:* [{{ finding.cve }}|{{ finding.cve|vulnerability_url }}]{% else %}*CVE:* Unknown{% endif %} {% if finding.cvssv3_score %} *CVSSv3 Score:* {{ finding.cvssv3_score }} {% endif %} +{% if V3_FEATURE_LOCATIONS %} +{% if finding.locations.all %} +*Systems/Locations*: +||Location||Status|| +{% for location_ref in finding.locations.all %}|{{ location_ref.location }}|{{ location_ref.get_status_display }}| +{% endfor %} +{% endif %} +{% else %} +{% comment %} TODO: Delete this after the move to Locations {% endcomment %} {% if finding.endpoints.all %} *Systems/Endpoints*: ||System/Endpoint||Status|| {% for endpoint in finding|get_vulnerable_endpoints %}|{{ endpoint }}|{{ endpoint|endpoint_display_status:finding }}| {% endfor %}{% for endpoint in finding|get_mitigated_endpoints %}|{{ endpoint }}|{{ endpoint|endpoint_display_status:finding }}| {% endfor %} -{%endif%} +{% endif %} +{% endif %} {% if finding.sast_source_object %} *Source Object*: {{ finding.sast_source_object }}