diff --git a/dojo/jira_link/views.py b/dojo/jira_link/views.py index 4e2a033305f..6ae03f8d4c9 100644 --- a/dojo/jira_link/views.py +++ b/dojo/jira_link/views.py @@ -241,8 +241,10 @@ def check_for_and_create_comment(parsed_json): findings = [jissue.finding] 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') elif jissue.finding_group: - findings = [jissue.finding_group.findings.all()] - 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') + findings = jissue.finding_group.findings.all() + first_finding_group = findings.first() + if first_finding_group: + 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') elif jissue.engagement: return webhook_responser_handler("debug", "Comment for engagement ignored") else: