Changes made to email templates doesn't work

Viktor Lytvyn January 26, 2021

In our Jira instance we needed to modify Subjects for Jira notifications for several projects.
We modified files in atlassian-jira\WEB-INF\classes\templates\email\subject, and tested then on Staging instance, where they worked as intended. (for that i used this article)
But they don't work on Prod instance. Can you please help to investigate what's the problem?

The code in most of them looks something like this:

#if ($issue.Project.key == "PROJ1" || $issue.Project.key == "PROJ2" || $issue.Project.key == "PROJ3" || $issue.Project.key == "PROJ4")
#if ($issue.issueType.name == "Bug")
#set ($emailIssueType = "Bug")
#elseif ($issue.issueType.name == "Epic")
#elseif ($issue.issueType.name == "Story")
#set ($emailIssueType = "Story")
#elseif ($issue.issueType.name == "Task")
#set ($emailIssueType = "Task")
#elseif ($issue.issueType.name == "Sub-task")
#set ($emailIssueType = "Sub-T")
#else
#set ($emailIssueType = "")
#end
#if ($issue.Priority)
#set ($emailPriority = "[P" + $textutils.left($issue.Priority.name,1) + "]")
#else
#set ($emailPriority = "")
#end
#set($joinCom = "")
#foreach($com in $issue.ComponentObjects)
#set($joinCom = $joinCom + "[" + $com.name + "]")
#end
[U][$emailIssueType][$textutils.left($issue.Status.name,12)]$emailPriority $eventTypeName: ($issue.key) $issue.summary $joinCom
#else
#disable_html_escaping()
($issue.key) $issue.summary
#end

1 answer

0 votes
Ravi Sagar _Sparxsys_
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 26, 2021

Hi @Viktor Lytvyn 

As written in the document it is not recommended to modify the vm files, these modifications have to be tracked and reapplied after future upgrades.

In case you still want to do it. Did you restart your production after making these changes. I think you have to set one property to avoid restart, check the document.

Also by any chance you have ScriptRunner for Jira? You can also use it to send custom emails.

Ravi

Viktor Lytvyn January 26, 2021

We did restart our prod instance several times.
It looked more like notifications didn't meet if condition at the start of script

Suggest an answer

Log in or Sign up to answer