- Introduction
- About
- Get started
- Migration to Cloud
- Bundled Fields
- Bundled Fields Overview
- Adding Bundled Fields
- Bundled Fields Configuration
- Format and validation
- Using Bundled Fields
- Advanced settings
- Bundled Fields Searcher
- Java API (ScriptRunner)
- Data Sources
- Email notifications
- Bundled Fields v.6.8.x - 6.9.x
- Bundled Fields v.6.7.x
- Dynamic Forms
- Dynamic Forms
- Supported fields
- Visibility
- Request Types visibility
- Fields visibility
- Customer Portal visibility
- Options visibility
- Requirements visibility
- SLAs visibility
- Java API
- Multilevel Structure
- Configuration
- Using a multilevel structure on the Customer Portal
- User Synchronization
- Organizations and Groups Synchronization
- Issue View
- Issue View
- Add user's IP address post function
- Restart SLA post function
- Update SLA to date post function
- Customer Portal
- Links
- Export list
- Split column
- Request details view
- Additional fields
- Additional options
- Compatibility
- Configuration Manager
Email notifications
Set up email notifications containing Bundled Fields data
The dedicated custom field for Bundled Fields can be included in email notifications that Jira sends to you after creating or modifying an issue that contains that custom field. However, Bundled Fields configuration slightly differs from the one provided by Jira. To avoid problems with displaying Bundled Fields incorrectly, follow the instructions below.
Batching email notifications (default in Jira 8.x)
In order to get a formatted custom field value in an email notification sent upon issue creation, mark the Bundled Fields custom field as renderable (for example, extend the RenderableTextCFType class).
This will enable choosing a renderer for the custom field in Jira fields’ configuration.
Changing the renderer
By default, the custom field’s contents are displayed in a .json format – which might be hard to read, especially when a lot of data is involved.
Here is how to increase the readability of that information:
Steps
- Go to Jira Administration > Issues.
- Open Field configuration.
- Select the Field Configuration that contains your custom field.
- Click Configure.
- Navigate to the chosen Bundled Fields’ custom field and click Renderers.
- Select [Extension] Bundled Fields Renderer.
- Click Update to save the change.
Bundled Fields Renderer will only change the format of data being displayed in email notifications and in other forms of data exports. It won’t affect the way Bundled Fields are displayed in Jira, or the values associated with those fields. It works for standard Jira notifications.
Standard notifications (Jira 7.x and older)
Before you start, create a proper email template (HTML format) and a .vm file according to these instructions.
Emails in text format
In a standard custom field’s configuration, you need to modify the issuecreated.vm
template with the following code that generates a formatted Bundled Fields value:
JIRA/atlassian-jira/WEB-INF/classes/templates/email/text/issuecreated.vm
...
#set ($bundledField = $customFieldManager.getCustomFieldObject("customfield_13700"))
#set ($bundledFieldType = $bundledField.getCustomFieldType())
#set ($bundledFieldValue = $issue.getCustomFieldValue($bundledField))
#set ($bundledFieldChangelogValue = $bundledFieldType.getChangelogString($bundledField, $bundledFieldValue))
#if ($bundledFieldValue)
$stringUtils.leftPad($bundledField.name, $padSize): $bundledFieldChangelogValue
#end
...
Emails in HTML format
In order to generate HTML-formatted emails, add the formattedbundledfields.vm
template to issuecreated.vm
JIRA/WEB-INF/classes/templates/email/html/includes/fields/formattedbundledfields.vm
#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_13700"))
#set ($customfieldType = $customfield.getCustomFieldType())
#set ($customfieldValue = $issue.getCustomFieldValue($customfield))
#set ($changelogValue = $customfieldType.getChangelogString($customfield, $customfieldValue))
#set ($encodedChangelogValue = $textutils.htmlEncode($changelogValue, false))
#set ($changelogValueHtml = $encodedChangelogValue.replaceAll( "\n","<br/>"))
#if($customfieldValue)
<tr>
<th>#text($customfield.name):</th>
<td class="has-icon">
$changelogValueHtml
</td>
</tr>
#end
JIRA/WEB-INF/classes/templates/email/html/issuecreated.vm
...
<table class="keyvalue-table">
...
#parse("templates/email/html/includes/fields/formattedbundledfields.vm")
...
</table>
...
Make sure to use the proper ID of your target Bundled Field to getCustomFieldObject parameter (presented Bundled Field’s ID is only exemplary).
When the file configuration is ready, remember to restart your Jira.
If you can’t find the answer you need in our documentation, raise a support request. Include as much information as possible to help our support team resolve your issue faster.