Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Need to add Epic Name in html email velocity template, only returning Key

Larry Katz October 1, 2014

I've created a custom .vm email html template for the purpose of showing the issue's Epic.

I can get the epic link "key" just fine, but I want to convert that to the Epic Key's corresponding name.

For example = if the epic key is TP-101, the name of it actually "Test Epic 1".


#disable_html_escaping()

#set($issueEpicKey = $issue.getCustomFieldValue("customfield_10204"))

#set($issueEpic = $issue.EpicLinkCFType().getEpicDisplayName($issueEpicKey))

<tr valign="top">

        <th><strong style="font-weight:normal;color:${textSubtleColour};">#text("Epic"):</strong></th>

    <td style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">

        $issueEpic

    </td>

</tr>


Am I using the correct Class to get the name?

 Thanks

-Lar

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Andreas Ebert
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.
October 5, 2014

I'm pretty sure, that "$issue.EpicLinkCFType()" won't work, because the class com.atlassian.jira.mail.TemplateIssue, which is used in mail templates, does not have a method like that.

Try something like this instead:

#set( $epicCF = $issue.getCustomField("customfield_10204") )
#set( $issueEpicKey = $issue.getCustomFieldValue($epicCF) )
#set( $epicDisplayName = $epicCF.getCustomFieldType().getEpicDisplayName($issueEpicKey) )
...
## use $epicDisplayName
TAGS
AUG Leaders

Atlassian Community Events