Adding Custom Fields to Email
Printing a custom field in a JIRA email is fairly easy in 3.6 and above. The feature request to integrate this into JIRA is being tracked at JRA-4619.
Step 1: Find the Custom Field ID
The Custom Field ID can be discovered from the database or by examining the URLs of custom field pages.
To find the Custom Field ID by examining the URL of a custom field page:
- Navigate to the Custom Field configuration in the JIRA administration console, as described on .
- Click the cog icon to display the menu for the custom field.
- Hover your mouse over the Configure item in the menu. The URL will display in the footer of your browser. The URL will show the Custom Field ID.
For example, in this screenshot, the ID of the custom field is 10000:
To find the Custom Field ID by querying the database:
Run the following query on your database:
where 'mycustomfield' is your custom field name.
Step 2: edit the velocity template
Locate the Velocity template of the email type you wish to modify. For instance, you may want to modify the 'issue created' template, as well as the template reused in 'issue commented':
Add the following snippet where you want it to appear in the file:
The javadoc for $stringUtils.leftPad can be found here: StringUtils.
atlassian-jira/WEB-INF/classes/templates/email/text/includes/issuesummary.vm you will want:
Note: you need to change the custom field id to the id observed in step 1. Here it is 10000 - yours will probably be different.
If you wish to iterate over all related custom fields you can use the following example:
To make the changes take effect, restart JIRA. If you wish to avoid the continual restarts during testing, edit
atlassian-jira/WEB-INF/classes/velocity.properties and alter this section as the comment says: