How to add Issue Status and Issue Resolution to email subject line in Jira?

Miko Makela February 8, 2012

I would like to add Issue Status and Issue Resolution to email subject line in Jira, but I don't know how to do it. Any help would be really appreciated.

Thanks in advance :)

2 answers

1 accepted

2 votes
Answer accepted
Dieter
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.
February 8, 2012

There is more information about that at

http://confluence.atlassian.com/display/JIRA/Customising+Email+Content

$issue.statusObject.name

$issue.resolutionObject.name

could be used in the velocity template to get the names of the status and resolution

Miko Makela February 9, 2012

it works! thanks!

hemanth acharya September 29, 2014

On the similar lines can we add 'Affects version' ? How do I do that?

Asher Aber May 6, 2015

The above link is broken :( Please post a detailed updated answer. Thanks

Dieter
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 7, 2015
Dieter
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 7, 2015
0 votes
TWC April 28, 2016

So just sharing information on how to add Issue status to the email subject lines in Jira.  This information was gathered for JIRA 7.0.10, so not sure about other versions.  A couple of things that I learned:

  1.  When closing an issue the <JIRA install>/WEB-INF/classes/templates/email/subject/issueclosed.vm is not called, but instead the issuegenericevent.vm is.  Not sure why but this is the way it is.
  2. When changing a ticket status from new to open the issueupdated.vm is not called, but instead the issuegenericevent.vm is.  Not sure why but this is the way it is.
  3. If you want to get the actual status in the subject line do not use $eventTypeName since it will return a value of updated when a ticket status is changed from new to open or from open to closed.

Here are the changes I made to the vm files in the <JIRA install>/WEB-INF/classes/templates/email/subject/ directory:

  Before:

                 ($issue.key) $issue.summary

  After:

                 ($issue.key) $issue.getStatusObject().getNameTranslation($i18n): $issue.summary

 

This will cause your subject line to look like this:

[JIRA] (CAT-2862) New: Test 28          *** this is for a new ticket being created

or 

[JIRA] (CAT-2862) Open: Test 28          *** this is for a ticket that is having it status changed to Open

or

[JIRA] (CAT-2862) Closed: Test 28          *** this is for a ticket that is having it status changed to Closed

and so on.

I hope this helps!

Deleted user March 8, 2017

It is not working for version 3.3 with editing the template (subject line).

Suggest an answer

Log in or Sign up to answer