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
Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events