Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Add Custom Field Value to Email Template

Christina Hiller
Contributor
July 22, 2019

I'm trying to add a custom field value to the create issue HTML email template, but stumbling.  The field is required, so there will always be a value present on issue creation.

Attempt 1:

I've followed the directions here: https://developer.atlassian.com/server/jira/platform/adding-custom-fields-to-email/?_ga=2.56485292.608403254.1563807890-1574526416.1556543036

When I add the customerfield.vm as indicated below

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

 

Instead of the comma separated values of the field, I get this message: $textutils.htmlEncode($issue.getCustomFieldValue($customfield), false) attempt 1_JIRA instruction.png

Attempt 2:

I tried the suggestion in another article, but instead of the value, I get the label name a second time.

#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_15707"))
#set ($customfieldvalue = $customfield.getValue($issue))
#if($customfieldvalue)
<tr>
<th>#text($customfield.name):</th>
<th>$customfield</th>
</tr>
#end

and tried

#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_15707"))
#set ($customfieldvalue = $customfield.getValue($issue))
#if($customfieldvalue)
<tr>
<th>#text($customfield.name):</th>
<th>$customfieldvalue</th>
</tr>
#end

attempt 2_community suggestion.png

 

 

I can't tell if my issue is coming from the createissue.vm or customfield.vm or how to fix it.  any help/suggestions would be very much appreciated!

2 answers

1 accepted

0 votes
Answer accepted
Bhushan Nagaraj
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 Champions.
June 11, 2013

Hi Srinivasan,

Customising email content on the On Demand instance is a restricted feature. Please read

https://confluence.atlassian.com/display/AOD/Restricted+Functions+in+Atlassian+OnDemand

Cheers

Bhushan

0 votes
Vladimir Horev _RaleyApps_
Atlassian Partner
November 20, 2015

Hello Srinivasan,

You can use our plugin to fully customize content of email notification from jira-ondemand. We also support conditional templating and custom fields.

Check it out https://marketplace.atlassian.com/plugins/net.vacom.jirassimo

Best,

Vladimir@Jirassimo

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events