Hello,
We are having an intermitted issue with displaying a custom field in an automatic generated email.
We updated the files per “Adding Custom Fields to Email” https://developer.atlassian.com/jiradev/jira-platform/jira-architecture/jira-templates-and-jsps/adding-custom-fields-to-email
And the field “Program Number” shows up sometimes but not in every email that is created during “Issue Creation”.
Thanks
Is the field always set? Are the workflows all firing the same "issue created" event for all issue creations? Is the code for the field in the template just a simple "if populated put it in email" or something more complex?
Hi Nic,
here is the code we used to add the "program number"
#if ($issue.getCustomFieldValue("customfield_10000"))
$stringUtils.leftPad($issue.getCustomField("customfield_10000").name, $padSize): $issue.getCustomFieldValue("customfield_10000")
#end
The field always has a numeric value but doesn't always show up in the actual email
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are all the workflows firing the right events to trigger the use of this template?
Does the field show anything in the email at all? (i.e. field name appears, but content is empty)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are all the workflows firing the right events to trigger the use of this template? I am waiting to hear from the user who noticed the problem.
Does the field show anything in the email at all?
Nothing, no label nor any data even though it is available on the "Create Issue" form email_program_number.jpg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, that implies your code is working, and the field is empty at creation. So the next question is - can we find a create-issue email which missed the field,and have a close look at the history - specifically for that one field - has it been changed at all on that issue?
We do need to take a look at the events going out and transition post-functions for create as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I don't understand. Could you look at the history of the issue (for which an email was sent without the field)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nic,
I changed the script in "issuetype.vm" by adding these lines
#if ($issue.getCustomFieldValue("customfield_10000"))
<tr><th>$stringUtils.leftPad($issue.getCustomField("customfield_10000").name, $padSize):</th><td>$issue.getCustomFieldValue("customfield_10000")</td></tr>
#end
user reported back to me that its working in multiple projects now. Thank you for taking time to help us out.
Joe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.