Skip to content

Commit 26e0fd1

Browse files
authored
Added relevant test name to "close old findings" comment (#13930)
* added relevant test name to close old findings comment * Added test url to close old finding comment * Better handling for close old findings comments
1 parent e9e426d commit 26e0fd1

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

dojo/importers/default_importer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Test_Import,
1919
)
2020
from dojo.notifications.helper import create_notification
21-
from dojo.utils import perform_product_grading
21+
from dojo.utils import get_full_url, perform_product_grading
2222
from dojo.validators import clean_tags
2323

2424
logger = logging.getLogger(__name__)
@@ -365,11 +365,13 @@ def close_old_findings(
365365
old_findings = old_findings.filter(Q(service__isnull=True) | Q(service__exact=""))
366366
# Update the status of the findings and any endpoints
367367
for old_finding in old_findings:
368+
url = str(get_full_url(reverse("view_test", args=(self.test.id,))))
369+
test_title = str(self.test.title)
368370
self.mitigate_finding(
369371
old_finding,
370372
(
371-
"This finding has been automatically closed "
372-
"as it is not present anymore in recent scans."
373+
'This Finding has been automatically closed by the Test: \n "' + test_title + '"\n' + url +
374+
"\n\nThis is because this Finding is not present anymore in recent scans."
373375
),
374376
finding_groups_enabled=self.findings_groups_enabled,
375377
product_grading_option=False,

0 commit comments

Comments
 (0)