It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Organizations In Email Template Issue HTML

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 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,388 views 11 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you