Forums

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

Velocity: Email template subject for batching notification problems

Fabian
Contributor
January 22, 2026

Hello,

i have a big problem. I need to change the email template in jira datacenter.

What i need is, that on every mail the mail subject should include a custom field value.

This solution works for the mail templates without batching notification:

issueupdate.vm

#set($customFieldManager = $componentManager.getCustomFieldManager())
#set($serialnumberField = $customFieldManager.getCustomFieldObject("customfield_10xxx"))
#set($serialnumber = $issue.getCustomFieldValue($serialnumberField ))

#if ($serialnumber)
  ($issue.key) [$serialnumber] $issue.summary
#else
  ($issue.key) $issue.summary
#end
Now i tried to implement it for the batchting notification file:
issueUpdateBatcher-subject.vm
#set($customFieldManager = $componentManager.getCustomFieldManager())
#set($serialnumberField = $customFieldManager.getCustomFieldObject("customfield_10xxx"))
#set($serialnumber = $issue.getCustomFieldValue($serialnumberField ))

#if ($serialnumber)
    #set($headersum = "[$serialnumber] " + "$header.issueSummary" + " with SNR")
    $i18n.getText('issue.update.batch.mail.subject', [$header.issueKey, $headersum])
#else
    #set($withoutSN = "$header.issueSummary" + " wihtout SNR")
    $i18n.getText('issue.update.batch.mail.subject', [$header.issueKey, $withoutSN ])

#end

The var serialnumber is always empty / null and i have no clue how to solve that issue.

I hope you can help me.

 

Thx

0 answers

Suggest an answer

Log in or Sign up to answer