Hi,
I am following the example of adding custom field to email as given in below link
https://developer.atlassian.com/display/JIRADEV/Adding+Custom+Fields+to+Email
The below is added to email/text/issuecreated.vm
#if ($issue.getCustomFieldValue("customfield_11193") != -1)
$stringUtils.leftPad($issue.getCustomField("customfield_11193").name, $padSize): $issue.getCustomFieldValue("customfield_11193")
#end
The below is added to the email/text/includes/issuesummary.vm
#if ($issue.getCustomFieldValue("customfield_11193") != -1)
>$stringUtils.leftPad($issue.getCustomField("customfield_11193").name, $padSize): $issue.getCustomFieldValue("customfield_11193")
#end
But the custom field is not appearing in the email.
Regards
Deepak Bhatia
Try use
#if ($issue.getCustomFieldValue("customfield_11193"))
like in documentation, not
#if ($issue.getCustomFieldValue("customfield_11193") != -1) .
The first solution worked for me, your solution did not with JIRA 4.4 and issuecommented.vm.
https://developer.atlassian.com/display/JIRADEV/Adding+Custom+Fields+to+Email
The example given in the above link is based for text based emails. But generally we use html based emails. Hence when I changed the HTML velocity templates, the above worked.
Yes you are right, #if ($issue.getCustomFieldValue("customfield_11193")) is working correctly. Rather the example given in the above is working correctly.
Thanks
Deepak Bhatia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried the above on jira4.1, unfortunately it doesn't work. I am basically trying to add a text custom field which should be straight forward. Please help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
did you remember to restart JIRA in order to have the changes take effect?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I have restarted the jira. Also I have made the
class.resource.loader.cache=false velocimacro.library.autoreload=true
to make changes in the velocity modules dynamic.
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.