Select fields to be shown in a Jira/Service Management/Transport issue update notification

By default, Jira and Service Management type system templates include in a notification for all the fields that have changed during an issue update and during Issue Creation (within ChangeLog table). The fields to be included can be changed without creating new custom templates. It can be done by updating the global custom macros.

Within Issue Created templates these changes will only apply to the ChangeLog Fields of the Notification. To change the Issue Attribute Fields see the following how-to.

If other fields that the specified ones have been changed, the email will be empty (no useful information rendered) and the notification will be ignored.

This change is global and it will reflected in all system templates. It is the simplest way to define which fields to show. If you need more customization, please visit How-to Create custom Theme and Template Sets.

Step-by-step guide

Ensure the identifier values for Custom Fields are of the customfield_id pattern i.e: customfield_1000 to prevent any erroneous No Content Found errors which causes notifications to be ignored

Change global custom macros

  1. Go to Notification -> Custom Macros -> Edit. 

  2. Add the following script updating the list as necessary. 

## Specify the fields to be shown during a JIRA issue update notification #set ($serviceJiraUpdateFields = ['issuetype','assignee','created','updated','priority','reporter', 'security','customfield_10200', 'security','labels'])
## Specify the fields to be shown during a Service Desk issue update notification #set ($serviceDeskUpdateFields = ['issuetype','summary','description','customfield_10200', 'security', 'labels'])

The screen should look like this:

 

Once saved, it can be testing by using the Preview tool:

  1. Go to Notification > Preview 

  2. Select either Issue Update JIRA or Issue Update Service Desk template

  3. Select a preview context

  4. Hit Preview

The email now only includes the fields in the $serviceJiraUpdateFields list that have been changed during the operation. 

Related articles