Add custom field to email content

Bruno Casimir January 27, 2021

Hello,

I am using JIRA Service Desk Application v3.16.8 .  I am trying to add a custom field to the email content so that the field content is appeared in the email notification on creation of the ticket. 

I followed this link and took into consideration the HTML part :

https://developer.atlassian.com/server/jira/platform/adding-custom-fields-to-email/

I added the following codes in the files issuecreated.vm and customfield.vm using the right custom field ID:

issuecreated.vm :

#parse("templates/email/html/includes/fields/customfield.vm")

 

customfield.vm :

#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_10402"))
#if($issue.getCustomFieldValue($customfield))
<tr>
<th>#text($customfield.name):</th>
<td class="has-icon">
$textutils.htmlEncode($issue.getCustomFieldValue($customfield), false)
</td>
</tr>
#end

The value of the field is not appeared in the email but instead the following line appears :

custom_field_name:  $textutils.htmlEncode($issue.getCustomFieldValue($customfield), false)

 

Can you please advise?

Best regards,

Bruno

 

1 answer

0 votes
Boris Berenberg - Atlas Authority
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2021

Not sure on the Velocity side of things, but we allow you to configure how email templates look, and what fields are included, using a WYSIWYG editor in Notification Assistant for Jira

Bruno Casimir February 2, 2021

Hello Boris,

Thank you for or answer. The solution you propose implies installing a new feature on jira and purchasing a license right? Is this the only way to fix this issue! Can you please confirm?

Best regards,

Bruno.

Boris Berenberg - Atlas Authority
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 2, 2021

Hi Bruno,

I am not a velocity expert so there may be a solution here that I am not aware of. My company makes Notification Assistant for Jira and it allows for customization of email templates using an editor in the UI.

Thanks,
Boris

Suggest an answer

Log in or Sign up to answer