Forums

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

What files do I edit to change batched notification templates?

Rene C. [Atlassian Support]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 20, 2019 edited

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
Contributor
March 28, 2023

Hey @Rene C. [Atlassian 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
Contributor
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
Contributor
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 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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 13, 2023

Hey @Rene C. [Atlassian 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])
Peter Szilagyi July 15, 2024

Hey,

 

the batcher-x.x.x.jar contains all the templates (.vm files) as well as a issue-update-batch-mail.properties which is a language property file with key=value pairs

 

in the above example you have to add the additional parameter in the array and then reference the value in the language property file like {2}

The variables which you can use are the following:

#* @vtlvariable name="batch" type="com.atlassian.jira.plugins.inform.api.batching.Batch" *#
#* @vtlvariable name="i18n" type="com.atlassian.jira.util.I18nHelper" *#
#* @vtlvariable name="baseurl" type="java.lang.String" *#
#* @vtlvariable name="escape" type="java.util.function.Function" *#
#* @vtlvariable name="header" type="java.lang.Object" *#
#* @vtlvariable name="fields" type="java.util.List" *#
#* @vtlvariable name="newIssueGroups" type="java.util.List" *#
#* @vtlvariable name="comments" type="java.util.List" *#
#* @vtlvariable name="commentCount" type="java.lang.Integer" *#
#* @vtlvariable name="commentMentionCount" type="java.lang.Long" *#
#* @vtlvariable name="issueKey" type="java.lang.String" *#
#* @vtlvariable name="issueUrl" type="java.lang.String" *#

#* @vtlvariable name="buildVersion" type="java.lang.String" *#
#* @vtlvariable name="currentBuildNumber" type="java.lang.String" *#
#* @vtlvariable name="commitId" type="java.lang.String" *#
#* @vtlvariable name="commitIdSha1" type="java.lang.String" *#
#* @vtlvariable name="partnerName" type="java.lang.String" *#

0 votes
Jörg Schauland
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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 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
Contributor
April 23, 2019 edited

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

Like • Rene C. [Atlassian Support] likes this
Rene C. [Atlassian 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
Contributor
April 25, 2019 edited

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 • 2 people like this
Evgeniy_Russkikh
Contributor
October 25, 2019

Hello!

Any progress with getting system fields values?

Like • 2 people like this
Nitin chaudhary May 22, 2020

@Joffrey_Hamman 

Hello

I am also trying same. Any update on this ?

Kevin Dalton
Contributor
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
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events