I need to add to the email notifications the "Epic Link" custom field.
I have used the below code:
#if ($issue.getCustomFieldObjectByName("customfield_10920"))
$stringUtils.leftPad($i18n.getCustomFieldObjectByName("customfield_10920").name, $padSize): $issue.getCustomFieldValue("customfield_10920")
#end
under WEB-INF/classes/templates/email/text and changed the velocity.properties, so as to avoid a restart.
Finally, I ended up with no email received.
Any ideas, how to add a custom field?
Aikaterini,
After quite a bit of tinkering I was able to get the Epic Link field to render in a notification email.
I had to first create a new template for the custom field at <jira_install>/atlassian-jira/WEB-INF/classes/templates/email/html/includes/fields/epic.vm
#disable_html_escaping()
<tr>
<th>$stringUtils.leftPad($issue.getCustomField("customfield_10000").name, $padSize):</th>
<td>$issue.getCustomFieldValue("customfield_10000")</a></td>
</tr>
Since I was testing the template behavior when an issue was created I added the #parse line to the keyvalue-table found in <jira_install>/atlassian-jira/WEB-INF/classes/templates/email/html/issuecreated.vm
<table class="keyvalue-table">
...
...
#parse("templates/email/html/includes/fields/epic.vm")
</table>
Once I did this the Epic Link field and value were rendered in the notification email when a new issue was created. Hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.