I have a custom field called "Affected End User" in the Create Issue screen. I wanted to add this custom field to the email notifications. This field is defined in the workflow "Create" transition when the user does not fill in this field.
I followed the Atlassian documentation on editing the email notification templates and adding a custom field to them. I created the affectedenduser.vm and added this code:
#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_10313"))
#if($issue.getCustomFieldValue($customfield))
<tr>
<th>#text($customfield.name):</th>
<td class="has-icon">
$textutils.htmlEncode($issue.getCustomFieldValue($customfield), false)
</td>
</tr>
#end
The email notification I received does not have the correct value for the custom field, as per this image:
I have no idea how to proceed, any help please?