What files do I edit to change batched notification templates?

Rene C_ _Atlassian Cloud Support_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 20, 2019

Raised in behalf of a customer:

I have edited the below files for email customizations.

$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issuementioned.vm 
$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issueresolved.vm 
$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issuecommentedited.vm 
$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issueclosed.vm 
$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issuecommented.vm 
$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issuegenericevent.vm 
$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issuedeleted.vm 
$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issueassigned.vm 
$JHOME/atlassian-jira/WEB-INF/classes/templates/email/html/issueupdated.vm

However these dont work for batch emails , what files do i edit to get similar templates ?

3 answers

1 accepted

0 votes
Answer accepted
Samuel Stephens March 28, 2023

Hey @Rene C_ _Atlassian Cloud Support_

Batched emails use a different set of templates to the ones you would have altered.

Think this KB should show you what you need to do. You'll need to pull them out with java, edit them then repackage them and upload them overwriting the system plugin.

https://confluence.atlassian.com/adminjiraserver085/customizing-email-content-batched-notifications-981155469.html

Kevin Dalton March 29, 2023

Worthless for batched emails since you cannot add system field's to batched emails even after multiple releases since its introduction.  

Great for non-batched emails.

Like Samuel Stephens likes this
Samuel Stephens March 29, 2023

Hi @Kevin Dalton 

I'm not 100% on this, but from my experience customising these batch emails, there are different #if conditions you'll need to define/alter in the IssueUpdateBatcher-history.vm file.

I think the intent of this file is to bring all of those separate .vm files (as listed above) into one place on an #if, #elseif, #end basis.

For my use case I had to remove certain lines from this file to remove information from the batch email that was sent to a user. Adversely you may be able to add information in I would think.

I'm assuming your issue is probably related to the following feature request for issue fields? If you haven't already you can vote for it here:

https://jira.atlassian.com/browse/JRASERVER-70206

Rene C_ _Atlassian Cloud Support_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 30, 2023

Hey, @Samuel Stephens ! Thanks for sharing the document! I created this post back when batched notifications where new, and added another comment myself with the procedure to achieve it which is pretty close to what is mentioned in the document. I am not longer part of the Jira Server/Data Center team but I'm glad there is a formal document for it.

Cheers!

rohit.mat April 13, 2023

Hey @Rene C_ _Atlassian Cloud Support_ ,


We tried to edit the IssueUpdateBatcher-subject.vm template and make the necessary changes and it works for us. But now my question here is, in the below line.. may i know where the getText() function and the issue.update.batch.mail.subject resource/property are defined.

$i18n.getText('issue.update.batch.mail.subject', [$header.issueKey, $header.issueSummary])
0 votes
Jörg Schauland March 19, 2024

Hello,

I'm on the same point.

I try to use system fields like "issuetype" for the mail subject. Some of the fields are working but a lot dosn't work. Is there anywhere a list of system fields, I allready can use for batched notifications?

For excamle: 

  • $header.issueKey
  • $header.issueSummary

 

Best Regards

0 votes
Rene C_ _Atlassian Cloud Support_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 20, 2019

The place to look for the templates is inside 2 new plugins added in Jira 8, located in the <Jira Installation directory>\atlassian-jira\WEB-INF\atlassian-bundled-plugins:

  • Jira inform - batchers: com.atlassian.jira.plugins.inform.batchers (batchers-1.0.23.jar)
  • Jira inform - batching plugin: com.atlassian.jira.plugins.inform.batching-plugin (batching-plugin-1.0.23.jar)
Joffrey_Hamman April 23, 2019

Hi,

Would you please be a little clearer about how to "open" this jar file and "find/edit" the template ?
Thank you.

[Updated]
It seems to be fully explained here:
https://confluence.atlassian.com/adminjiraserver/adding-custom-fields-to-emails-batched-notifications-968669988.html

Rene C_ _Atlassian Cloud Support_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 24, 2019

Glad you found it and yes, you can use the same procedure to repackage any jar file Jira uses, including language packs!

Like Joffrey_Hamman likes this
Joffrey_Hamman April 25, 2019

What I want to do, is to add the following elements in the mail subject:

  • status
  • type
  • component
  • customfield_10008

I found how to do for the first one (status) => $header.issueStatus.name

But I didn't find how to do for the others..

For the custom field, I tried the two following solutions but both don't work.

#if(${customFields.get('customfield_10008').getValue()})
#set( $severity = $issue.getCustomFieldValue($customfield) )
#end

#if(${customFields.get('customfield_10008').getValue()})
#set( $severity = ${customFields.get('customfield_10008').getValue()} )
#end

The end of the file is the following:

#set( $status = $header.issueStatus.name )
#set( $emailsubject = "(${key} ${status}) ${severity}"
$i18n.getText('issue.update.batch.mail.subject', [$emailsubject, $header.issueSummary])

 

Some help ? :)

Like # people like this
Evgeniy_Russkikh October 25, 2019

Hello!

Any progress with getting system fields values?

Like # people like this
Nitin chaudhary May 22, 2020

@Joffrey_Hamman 

Hello

I am also trying same. Any update on this ?

Kevin Dalton September 3, 2020

Same here we are trying to get our to match single emails without any luck

Suggest an answer

Log in or Sign up to answer