How to add epic name to mail notification?

Hi there.

I receive issues mail notifications without epic name included. Is it possible to add epic name to my mail notification? (With html, I guess)

Thank you.

 

3 answers

This widget could not be displayed.

There are two ways to do it: Modify the JIRA email templates, which requires server access and knowledge of velocity, or you can use an addon and customize your notifications in the JIRA interface. 

I would recommend Notification Assistant for a light-weight easy to use add-on, see: https://marketplace.atlassian.com/plugins/com.riadalabs.jira.plugins.notificationassistant

Or if you want a more comprehensive control over everything mailrelated, check out JEMH:

 https://thepluginpeople.atlassian.net/wiki/display/JEMH/JEMH+Home.

This widget could not be displayed.

Stas,

     I was able to add the epic name to e-mails by modifying the templates which does require server access.  Additionally, this article explains how to configure JIRA to avoid the necessity of restarting to make the changes take effect during testing, https://developer.atlassian.com/jiradev/jira-platform/jira-architecture/jira-templates-and-jsps/adding-custom-fields-to-email.  One thing I did was to create a custom.vm file that puts the custom information in the e-mail, see the code below.  I stored the custom.vm file in the 'includes' directory then I modified my other templates to parse this file, e.g. #parse("templates/email/includes/custom.vm").  This allows me to make changes in one place and I can insert the parse directive where ever I want the information to appear.  I am using the text templates so this is fairly simple but the e-mail formatting can be tedious.  I also modified the subject template, e.g. 'issuementioned.vm', in the 'subject' directory to include the epic name in the subject, see the second code block.  The code displayed here is wrapped but when you place it in the subject template it must all be on a single line immediately following the "#disable_html_escaping()" directive.

I hope this helps.

If you find this helpful accepting this as an answer would be appreciated.

 

custom.vm

## Add Custom Information to the e-mail notice
    Custom Information:
    #dashes($!issue.getSummary())
    Project: $issue.getProject().name
#if ($issue.getSummary()) ##
    Issue Summary: $issue.getSummary()
#end
#if ($issue.getDescription()) ##
    Issue Description : $issue.getDescription()
#end
#set ($issueType = $issue.getIssueTypeObject().name)
#if ($issueType == "Epic")
    #if ($issue.getCustomFieldValue($customFieldManager.getCustomFieldObject("customfield_10011")))
##
        Customer: $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject("customfield_10011"))
    #end
##
    Linked Issue Info (tasks in epic): ##
    #end
    #foreach ($outlink in $outlinks)
##
    Linked Issue (key-name): $outlink.destinationObject.key - $outlink.destinationObject.summary ##
    #end
#else
    #if ($issue.isSubTask())
        #set ($issueParent = $issue.getParentObject())
        Parent issue: $issueParent.getKey() - $issueParent.getSummary()
        #set( $epicCF = $customFieldManager.getCustomFieldObject("customfield_10006") )
        #set( $epicKey = $issueParent.getCustomFieldValue($epicCF))
        #set( $epicDisplayName = $epicCF.getCustomFieldType().getEpicDisplayName($epicKey))
    #else
        Issue: $issue.key - $issue.summary
        #set( $epicCF = $customFieldManager.getCustomFieldObject("customfield_10006") )
        #set( $epicKey = $issue.getCustomFieldValue($epicCF))
        #set( $epicDisplayName = $epicCF.getCustomFieldType().getEpicDisplayName($epicKey))
    #end
    Issue Epic Key: $epicKey
    Issue Epic Name: $epicDisplayName ##
#end
    #dashes($!issue.getSummary())

Subject Line Code:

$issue.getKey(): $issue.getSummary() -#if 
($issue.getIssueTypeObject().name == "Task") #set( $epicCF = 
$customFieldManager.getCustomFieldObject("customfield_10999")) #set( 
$epicKey = $issue.getCustomFieldValue($epicCF)) 
$epicCF.getCustomFieldType().getEpicDisplayName($epicKey) -#end 
#if($issue.isSubTask()) #set ($issueParent = $issue.getParentObject()) 
#set( $epicCF = 
$customFieldManager.getCustomFieldObject("customfield_10999")) #set( 
$epicKey = $issueParent.getCustomFieldValue($epicCF)) 
$epicCF.getCustomFieldType().getEpicDisplayName($epicKey) -#end 
#if($remoteUser)${remoteUser.displayName}#else$i18n.getText("common.words.anonymous")#end
 $i18n.getText("jira.mentions.mentioned.you") (JIRA)

 

Related Questions:

https://answers.atlassian.com/questions/9383925

https://answers.atlassian.com/questions/243757

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

155 views 2 0
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