Skip to content

Commit 8ddb608

Browse files
committed
jira link updates
1 parent 0ddd362 commit 8ddb608

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

dojo/jira_link/helper.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,10 @@ def jira_priority(obj):
740740

741741
def jira_environment(obj):
742742
if isinstance(obj, Finding):
743-
return "\n".join([str(endpoint) for endpoint in obj.endpoints.all()])
743+
if not settings.V3_FEATURE_LOCATIONS:
744+
# TODO: Delete this after the move to Locations
745+
return "\n".join([str(endpoint) for endpoint in obj.endpoints.all()])
746+
return "\n".join([str(location_ref.location) for location_ref in obj.locations.all()])
744747
if isinstance(obj, Finding_Group):
745748
envs = [
746749
jira_environment(finding)
@@ -1917,7 +1920,12 @@ def process_resolution_from_jira(finding, resolution_id, resolution_name, assign
19171920
finding.mitigated = jira_now
19181921
finding.is_mitigated = True
19191922
finding.mitigated_by, _created = User.objects.get_or_create(username="JIRA")
1920-
finding.endpoints.clear()
1923+
if settings.V3_FEATURE_LOCATIONS:
1924+
for location_ref in finding.locations.all():
1925+
location_ref.location.disassociate_from_finding(finding)
1926+
else:
1927+
# TODO: Delete this after the move to Locations
1928+
finding.endpoints.clear()
19211929
finding.false_p = False
19221930
ra_helper.risk_unaccept(User.objects.get_or_create(username="JIRA")[0], finding)
19231931
status_changed = True

0 commit comments

Comments
 (0)