Forums

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

Add custom field to issueupdate velocity mail template

Michael Shechter August 5, 2020

Hello,

I'm trying to add a custom field named "Responsible team" (Group picker) to update issue template baed on Adding custom fields to email Wiki

I already add this custom field to my issue created template and I work as expected.

if I'm trying to add the custom field the field location is wrong as you see screen-shot:

Screen Shot 2020-08-06 at 8.56.37.png

 

My issueupdate.vm:

#disable_html_escaping()

#defaultMailHeader("jira.email.title.issue.updated", $changelogauthor)


#rowWrapperNormal("#parse('templates/email/html/includes/patterns/issue-title.vm')" '' 'wrapper-special-margin')
#if ($comment)
#parse('templates/email/html/includes/patterns/comment-top.vm')
#end

#if ($changelog)
#rowWrapperNormal("#parse('templates/email/html/includes/fields/changelog.vm')" '' 'wrapper-special-margin')
#end

#parse('templates/email/html/includes/changelog-issue-description.vm')


##rowWrapperNormal("#parse('templates/email/html/includes/fields/customfield.vm')" '' 'wrapper-special-margin')


## Responsible Team custom field ###
#rowWrapperNormal("#parse('templates/email/html/includes/fields/customfield.vm')" '' 'wrapper-special-margin')

#set ($commentActionBody="#parse('templates/email/html/includes/patterns/comment-action.vm')")
#rowWrapperNormal($commentActionBody)




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

 

my customfield.vm:


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

 

 

What I'm doing wrong?

Thank!

 

 

 

 

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.
August 6, 2020

We make Notification Assistant for Jira (https://marketplace.atlassian.com/apps/1211069/notification-assistant-for-jira-email) that makes it a lot easier to configure which fields show up instead of trying to hack on the VM templates. 

Michael Shechter August 8, 2020

Thank you @Boris Berenberg - Atlas Authority  but I do not modify Jira templates    often that justifies the purchase of a plugin

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.13.1
TAGS
AUG Leaders

Atlassian Community Events