custom fields inside email

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

1 answer

0 vote

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

 

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)

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

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.

How can I find the history for an issue email?

 

Sorry, I don't understand.  Could you look at the history of the issue (for which an email was sent without the field)?

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

112 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you