Hi, I am trying to get a custom field to appear in our plain text emails. The field properly appears in the email for the Create issue action which I know uses:
\atlassian-jira\WEB-INF\classes\templates\email\text\issuecreated.vm
However, for emails for other events, such as Comments or Resolved, the custom field doesn't appear, and I know it has a value in the issue. I know the template used in this case is:
\atlassian-jira\WEB-INF\classes\templates\email\text\includes\issuesummary.vm
And this is my code added:
#if ($issue.getCustomFieldValue("customfield_10661"))
>$stringUtils.leftPad($issue.getCustomField("customfield_10661").name, $padSize): $issue.getCustomFieldValue("customfield_10661")
#end
Why doesn't the custom field get displayed here?
My bad. The problem was that I was putting the custom field within the attachments section's if/then logic. Thought I was outside of it, but I missed seeing that straggling #end statement!
#if ($attachments && $attachments.size() >0)
>$stringUtils.leftPad($i18n.getText("template.attachments"), $padSize): #foreach ($attachment in $attachments)$attachment.getFilename()#if ($velocityCount != $attachments.size()), #end#end
>
#end
Thanks Sean. That makes sense. Although when I add the same bit of code right near the top of issuesummary.vm (just before #if ($issue.securityLevel)), then the field displays. It doesn't like it near the bottom, after the attachments section. I don't understand what would make the difference?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd have to check but I'm pretty sure fields only display on emails when they've been changed. If you edit an issue and change fields A, B and D you shouldn't see any mention of field C in the resulting email.
I'll take a look and see if there's a nice way to always show the value of a specific custom field on an email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd have to check but I'm pretty sure fields only display on emails when they've been changed. If you edit an issue and change fields A, B and D you shouldn't see any mention of field C in the resulting email.
I'll take a look and see if there's a nice way to always show the value of a specific custom field on an email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.