You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
We want to add the Custom Field Organizations to our Email Subject Line and Body.
I've used many of the resources and while they've worked for other custom fields it has not worked for this particular one. Organizations is also LOCKED custom field if that matters.
in the issuecreated.vm email notification this is what I have:
#disable_html_escaping()
#defaultMailHeader("email.event.activity.created.issue", $issue.reporter)
#set ($issueTitleBody="#parse('templates/email/html/includes/patterns/issue-title.vm')")
#rowWrapperNormal($issueTitleBody)
#rowWrapperNormalBegin('' 'wrapper-special-margin')
<table class="keyvalue-table">
#parse("templates/email/html/includes/fields/issuetype.vm")
#parse("templates/email/html/includes/fields/affectsversions.vm")
#parse("templates/email/html/includes/fields/assignee.vm")
#parse("templates/email/html/includes/fields/attachments.vm")
#parse("templates/email/html/includes/fields/components.vm")
#parse("templates/email/html/includes/fields/createddate.vm")
#parse("templates/email/html/includes/fields/duedate.vm")
#parse("templates/email/html/includes/fields/environment.vm")
#parse("templates/email/html/includes/fields/fixversions.vm")
#parse("templates/email/html/includes/fields/labels.vm")
#parse("templates/email/html/includes/fields/priority.vm")
#parse("templates/email/html/includes/fields/reporter.vm")
#parse("templates/email/html/includes/fields/securitylevel.vm")
#parse("templates/email/html/includes/fields/timetracking.vm")
#parse("templates/email/html/includes/fields/organization.vm")
#parse("templates/email/html/includes/fields/vendordetails_cf.vm")
</table>
#rowWrapperNormalEnd()
#if ($issue.description)
#set($textParagraph = $issue.htmlDescription)
#rowWrapperNormal("#parse('templates/email/html/includes/patterns/text-paragraph.vm')", '', 'issue-description-container')
#end
#set ($commentActionBody="#parse('templates/email/html/includes/patterns/comment-action.vm')")
#rowWrapperNormal($commentActionBody)
#parse("templates/email/html/includes/footer.vm")
and for the organization.vm file I have:
#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_13401"))
#if($issue.getCustomFieldValue($customfield))
<tr>
<th>#text($customfield.name):</th>
<td class="has-icon">
$customFieldManager.getCustomFieldObject("customfield_13401").getValue($issue)
</td>
</tr>
#end
The returned value I'm getting is [CustomerOrganizationImpl{id=307,name=Plaza Loans}]
What I'm hoping it would just return the name Plaza Loans.
You'll notice there's #parse("templates/email/html/includes/fields/vendordetails_cf.vm") in the issuecreated.vm and the vendordetails_cf.vm is identical just with different custom field ID's and that one is working like a beauty.
I used this resource since it's helped me the most so far:
https://community.atlassian.com/t5/Jira-Core-questions/Add-Custom-Field-Value-to-Email-Template/qaq-p/1136371
I also