dependency-track icon indicating copy to clipboard operation
dependency-track copied to clipboard

Notifications subjects - add additional information (e.g. Project/Component/Severity) into Subject string

Open JN-CSIRT opened this issue 2 years ago • 7 comments

Current Behavior:

The notification email's subject are hard coded right now.

Proposed Behavior:

add the notification subject configuration to the notification template and use same params as there exists for content.

JN-CSIRT avatar Jul 25 '22 13:07 JN-CSIRT

Current Behavior:

The notification email's subject are hard coded now and contain the project name (twice) only. E.g.: "New Vulnerability Identified on Project: [[PROJECTID]: [PROJECTID] : [VERSION]]"

Proposed Behavior: add the notification subject configuration to the notification template in order to add all necessary information E.g.: {{ notification.title }}

{% if notification.group == "NEW_VULNERABILITY" %} Email Subject: {{alert.name}}: {{ subject.component.project.name }}: {{ subject.component.project.version }}: {{ subject.component.toString }} {{ subject.component.version.toString }} {{ subject.vulnerability.severity }} Vulnerability ID: {{ subject.vulnerability.vulnId }} Vulnerability URL: {{ baseUrl }}/vulnerability/?source={{ subject.vulnerability.source }}&vulnId={{ subject.vulnerability.vulnId }} Severity: {{ subject.vulnerability.severity }} Source: {{ subject.vulnerability.source }} Component: {{ subject.component.toString }} Component URL: {{ baseUrl }}/component/?uuid={{ subject.component.uuid }} Project: {{ subject.component.project.name }} Version: {{ subject.component.project.version }} Description: {{ subject.component.project.description }} Project URL: {{ baseUrl }}/projects/{{ subject.component.project.uuid }} {% if notification.subject.affectedProjects|length > 1%}

JN-CSIRT avatar Dec 05 '22 08:12 JN-CSIRT

This issue was originally raised in discussion #1811

Customizable Notification Templates were introduced in v4.6 (released October 11 2022, since this enhancement was logged) but support only customization of body... with subject still being hard-coded as of v4.7.1

msymons avatar Mar 07 '23 15:03 msymons

According to syalioune:

My previous answer still apply. While v4.6.0 introduced customization features, it was for the notification body content. The notification title, thus email subject, is unfortunately still hardcoded. Enhancement request #1823 is still valid.

JN-CSIRT avatar Mar 08 '23 12:03 JN-CSIRT

@JN-CSIRT, I know this enhancement request is still valid.. that is why I have assigned it a priority and a milestone.

msymons avatar Mar 08 '23 14:03 msymons

Hi Mark, thanks a lot!

JN-CSIRT avatar Mar 08 '23 14:03 JN-CSIRT

Would be great to have also possibility to put severity in e-mail subject (well any field really). Subject is very important for mail automation rules as mentioned in the discussions.

girtsn avatar Jun 01 '23 10:06 girtsn

Reopening because the original ask was for supporting templating.

nscuro avatar Feb 07 '24 15:02 nscuro