How to add custom fields to email template

Hi,

Please suggest me how I can add custom fields in the create screen to create issue email template?

Also I'm having around 50 custom fields in the create screen across all the eight issue types and want to know

1. whether I can add all these custom fields to create issue template or I need to use different template for each workflows?

2. If having single issue create template then all the custom fields will be show it in email or only value contains custom field will be visible in email?

3. I got that following parameter needs to be add for displaying the custom field in email, $issue.getCustomFieldValue("customfield_10150")

but where in create issue template I can place this kind of 50 parameter?

Many thanks in advance.

Thanks,

Sanu P Soman

1 answer

1 accepted

0 vote

You could always read the docs - https://confluence.atlassian.com/display/JIRA/Customising+Email+Content

For the other questions:

1) I don't think I fully understand the question. You can put the fields on the create screen for each individual project/issuetype, or groups, or you can use the same screen for everything. Up to you.

2) Either. The standard behaviour is not to include empty fields in emails, and that's what the docs cover, but you can override it if you want.

3) Again, I really don't understand the question. What is a "create issue template"? Do you mean the create screen? If so, then you add fields by their name, not custom field ID. If you don't mean the screen, then I'm utterly lost and you'll need to explain more.

I think you probably need to work through https://confluence.atlassian.com/display/JIRA/Configuring+Fields+and+Screens as well - that should guide you through the basics

I mean create issue template is the create issue event(notification event) in JIRA specifying in "createissue.vm" file.

So how I can add create screen custom field details in createissue.vm file ?? Please guide me.

Thanks.

It's in the documentation I referred to. That tells you how to add fields to the templates. I don't know how else I can explain this.

Could you explain what you are not understanding in the docs?

Could you please clarify me exactly where I can add the following parameter in createissue.vm file

$issue.getCustomFieldValue("customfield_10150"), any specific line is there or I can add it in any line.

Think of the createissue.vm as a template for creating the html. It will be read from top to bottom, one word or phrase at a time. If a phrase starts with a # velocity will see it as a directive (#if, #else, #foreach, #end etc), and if it starts with a $, velocity will see it as a variable to be output (either an actual variable, or the result from running some java). Everything else will come out as it is in the file.

So your line can go anywhere you want it to, but you'll probably want it in a specific place to make the email look nice - probably after, or between, the calls generating the other fields in the output. If in doubt, then simply bung it on the end of the file in your dev system, and then experiment with moving it!

Thanks a lot for elaborating. I'll try the same in dev environment.

Cheers,

Sanu P Soman

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Amir Kazemi
Posted an hour ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

9 views 0 2
Join discussion

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