Custom Fields on email notifications

Deleted user December 10, 2013

Is it possible to add a custom field to the "Issue Created" and "Issue Summary" notifications that are sent out?

I have added (I think) the custom field to;

issuecreated.vm and issuesummary.vm

and restarted the JIRA instance, but the emails do not have this information on them, I added the following lines;

#if ($issue.getCustomFieldValue("customfield_10910"))
$stringUtils.leftPad($issue.getCustomField("customfield_10910").name, $padSize): $issue.getCustomFieldValue("customfield_10910")
#end

6 answers

1 accepted

0 votes
Answer accepted
John Bishop
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.
December 10, 2013

You'll need to follow the steps on this link: https://developer.atlassian.com/display/JIRADEV/Adding+Custom+Fields+to+Email

It will require you to modify some Jira templates.

This will add the custom fields to all Jira emails for all projects.

My company instead decided to create custom listeners which allow us to create project and event specific emails with all the information we want.

Deleted user December 10, 2013

This is what I tried last time, thats how I got the code (above)

John Bishop
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.
December 10, 2013

Their example for issuesummary.vm has an additional ">" that you don't have. I'm not sure if it makes a difference or not, but you might try adding it.

Also, are there any errors related to this in Jira's logs?

Deleted user December 10, 2013

They missed that for the first one but have it for ther others (although the other lines in the .Vm file do not use that) I'll test that tonight.


Nope, no errors that I can see

3 votes
sandeepkolte March 19, 2018

My solution to notify someone when a custom JIRA field is modified is to use the Filter and Subscriptions.

E.g. If I needed a notification sent out whenever our custom field ‘Test Notes’ is updated, I would create a filter such as says ‘Test Notes Updated in last 1 hour’ with following search criteria

 "Test Notes" is not EMPTY AND updated > -1h

 Next, save the filter. Search your saved filter in Manage Filters. Click Subscribe under Subscriptions column. Add subscription using the on screen options for Recipients, Schedule, Interval etc. If you need one or more people to receive the notifications, create a JIRA group under JIRA User Management options / Groups tab on the left. e.g. jira-testers: Once you add the subscription, that’s it, it is not instantaneous as you are asking it to notify everything updated in last one hour (1h in the filter above) but you can make it so if you want by changing your filter.

 SK

1 vote
Vladimir Horev _Raley_
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.
January 10, 2018

Another way (without programming) is to use Raley Email Notifications where all Jira custom fields are first-class citizens and you can add any of those to your message template.

Vlad

1 vote
Sebastian July 2, 2015

I am trying to add a custom field to the 'issue created' template by adding this code:

#if ($issue.getCustomFieldObjectByName("customfield_10100"))
>$stringUtils.leftPad($issue.getCustomFieldObjectByName("customfield_10100").name, $padSize): $issue.getCustomFieldValue("customfield_10100")
#end

where 10100 is the ID of custom field created in JIRA. Unfortunately this solution does not work me, I received email notification without this field.

I am wokring on JIRA v6.4.7

Am I missed something? Please advise.

Martina Riedel
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.
June 28, 2017

To add a custom field to the "issue created" email, you have to update the ..../templates/email/text/issuecreated.vm for users receiving text emails AND
....../templates/email/html/issuecreated.vm for users receiving html emails.

html is the default these days.

I ended up creating ...../templates/email/html/includes/fields/mycustomfield.vm and parsed that in the html/issuecreated.vm.

I may be overkill, but it worked for me.

0 votes
RambanamP
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.
December 10, 2013
Deleted user December 12, 2013

Unfortunatly this doesn't really help. If it does help then the field I want to put in is just a dropdown box which allows you to select a custom priority field.

0 votes
Deleted user December 10, 2013

This is what I tried last time, thats how I got the code (above)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events