Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Editing Mail template for "Commented Issues"

Jason Galea
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.
August 17, 2020

Hi,

I am currently working on an amendment for sending notifications when a ticket is commented.

With the current default configuration on JIRA v8.3.x, when a comment is added into a ticket, an email is sent to people listing the initiator or the comments, issue type icon, and issue key

screenshot A.PNG

The image above is using the default template

I recently has a request from JIRA user that they would also like the current status of the ticket

I looked into some documentation and found out that the template can be modified by editing the 'macros.vm' file located in WEB-INF/classes/templates/email/

I managed to locate where the template can be modified by editing the line below

#set ($issueLink = "<a href='${baseurl}/browse/${issue.getKey()}'>#renderIssueTypeIcon(${issueType}) $textutils.htmlEncode($issue.getKey())</a>")

to...

#set ($issueLink = "<a href='${baseurl}/browse/${issue.getKey()}'>#renderIssueTypeIcon(${issueType}) $textutils.htmlEncode($issue.getKey())</a> paste status here")

 

This is the result i got when commenting on a ticket:
screenshot B.PNG

So i decided the add the issue status parameter instead by adding {issue.getStatus()}

#set ($issueLink = "<a href='${baseurl}/browse/${issue.getKey()}'>#renderIssueTypeIcon(${issueType}) $textutils.htmlEncode($issue.getKey())</a> {issue.getStatus()}")

But this is the result i get....

screenshot C.PNG

It looks like it did capture the status but i would like to see the status in GUI format. (Just like the issue type icon)

Any ideas on how i can achieve this?

 

Cheers,
Jason

1 answer

0 votes
Boris Berenberg - Atlas Authority
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.
August 17, 2020

You can access the Name property that's being returned there. However since you will also need to manually maintain this across every Jira upgrade, I would recommend you use a third party app like ours that allows your customizations to persists across upgrades: https://marketplace.atlassian.com/apps/1211069/notification-assistant-for-jira-email?hosting=datacenter&tab=overview

Suggest an answer

Log in or Sign up to answer