How to add custom fields to email template

S
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 29, 2012

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 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 29, 2012

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

S
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 29, 2012

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.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 29, 2012

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?

S
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 30, 2012

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.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2012

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!

S
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 30, 2012

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