Skip to content

Commit f9dfd29

Browse files
authored
Fix create notification for group of findings (#10433)
* Fix create notification execution for group of findings * Create notification for comment for group of findings if findings exist * Update notification title when a new comment is added for group of findings --------- Co-authored-by: Camilo Cota <ccota@redhat.com>
1 parent 852860f commit f9dfd29

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

dojo/jira_link/views.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ def check_for_and_create_comment(parsed_json):
241241
findings = [jissue.finding]
242242
create_notification(event='jira_comment', title=f'JIRA incoming comment - {jissue.finding}', finding=jissue.finding, url=reverse("view_finding", args=(jissue.finding.id,)), icon='check')
243243
elif jissue.finding_group:
244-
findings = [jissue.finding_group.findings.all()]
245-
create_notification(event='jira_comment', title=f'JIRA incoming comment - {jissue.finding}', finding=jissue.finding, url=reverse("view_finding_group", args=(jissue.finding_group.id,)), icon='check')
244+
findings = jissue.finding_group.findings.all()
245+
first_finding_group = findings.first()
246+
if first_finding_group:
247+
create_notification(event='jira_comment', title=f'JIRA incoming comment - {jissue.finding_group}', finding=first_finding_group, url=reverse("view_finding_group", args=(jissue.finding_group.id,)), icon='check')
246248
elif jissue.engagement:
247249
return webhook_responser_handler("debug", "Comment for engagement ignored")
248250
else:

0 commit comments

Comments
 (0)