Create custom Theme and Template Sets
In this article we're going to show how to change issue notifications by customizing the JIRA theme and its Template Sets. The customization will change the email header showing a generic support avatar rather than the user avatar when the issue has been created or changed by a user of the developer group. You can follow the same steps to change other aspects of a Theme.
Step-by-step guide
Create a copy of JIRA theme and it's issue template sets.
Go to Notifications -> Theme -> Create
Select the theme, e.g. JIRA (System) as your source of templates and select the Issue Template Sets required (CTRL + left mouse click).
Submit. This will copy the JIRA theme, 3 Template Sets and it will take you to the new theme edit screen. In the macro tab, replace the jemhIncludeStandardActionHeader and jemhIncludeBody macros with the macros below.
Support Jira Header Macro
Depracted (Old)
#macro ( jemhIncludeStandardActionHeader)
<tr>
<td id="header-pattern-container">
<table id="header-pattern">
<tr>
#if ($context.user)
<td valign="top" id="header-avatar-image-container">
#if ($jemhUtils.isCreatedByEmailUser())
<IMG height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top" SRC='$jemhUtils.inlineImage($jemhUtils.getImageUrl("EmailUserIcon1"))' alt='$messageUtils.getMessage("velocity.macro.action.header.emailUser")'/>
#elseif($jemhUtils.hasUserRole($jemhUtils.getOperationUser(),'developers'))
<IMG height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top" SRC='$jemhUtils.inlineImage($jemhUtils.getImageUrl("SupportUserIcon4"))' alt='$messageUtils.getMessage("velocity.macro.action.header.support")'/>
#else
<IMG class="image_fix" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top" SRC='$jemhUtils.inlineImage($context.user.avatarUrls["32x32"].asText())' alt='$context.user.displayName.asText()'/>
#end
</td>
<td id="header-text-container" valign="middle">
#if ($jemhUtils.isCreatedByEmailUser())
<span>$messageUtils.getMessage('velocity.macro.action.header.emailUser')</span>
#elseif($jemhUtils.hasUserRole($jemhUtils.getOperationUser(),'developers'))
<span>$messageUtils.getMessage('velocity.macro.action.header.support')</span>
#else
<a class="user-hover" rel="$context.user.name.asText()" id="email_$context.user.name.asText()" href="$baseurl/secure/ViewProfile.jspa?name=$context.user.name.asText()">$jemhUtils.htmlEscape($context.user.displayName.asText())</a>
#end
<strong>$messageUtils.getMessage("velocity.macro.action.header.$jemhUtils.webhookEvent")</strong> $messageUtils.getMessage('velocity.macro.action.header.anIssue')
</td>
#else
<td valign="top" id="header-avatar-image-container">
<IMG height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top" src="$jemhUtils.inlineImage($jemhUtils.getImageUrl('AnonymousUserIcon'))" alt='$messageUtils.getMessage("velocity.macro.action.header.anonymous")'/>
</td>
<td id="header-text-container" valign="middle">
$messageUtils.getMessage('velocity.macro.action.header.anonymous')
<strong>$messageUtils.getMessage("velocity.macro.action.header.$jemhUtils.webhookEvent")</strong> $messageUtils.getMessage('velocity.macro.action.header.anIssue')
</td>
#end
</tr>
</table>
</td>
</tr>
#end
Jira theme
#macro ( jemhIncludeStandardActionHeader)
<tr>
<td id="header-pattern-container">
<table id="header-pattern">
#if ($jemhUtils.webhookEvent)
<tr>
#set($authors = $jemhUtils.getChangelogAuthors())
#set($maxRenderedUsersCount = 1)
#foreach($user in $authors)
#if($foreach.count == $maxRenderedUsersCount)
#if ($user)
#if ("$jemhUtils.getUserAvatar($user,'32x32')" != "" )
<td valign="top" id="header-avatar-image-container">
<IMG class="image_fix" height="32" width="32" border="0"
style="border-radius: 3px; vertical-align: top"
SRC="$jemhUtils.getUserAvatar($user,'32x32')"
alt='$jemhUtils.getUserDescription($user)'/>
</td>
#end
<td id="header-text-container" valign="middle">
<a class="user-hover" rel="$jemhUtils.getUserAccountId($user)" id="email_$jemhUtils.getUserAccountId($user)"
href="$jemhUtils.getUserProfileUrl($user)">$jemhUtils.htmlEscape($jemhUtils.getUserDescription($user))</a>
</td>
#else
<td valign="top" id="header-avatar-image-container">
<IMG height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"
src="$jemhUtils.getImageUrl('AnonymousUserIcon')"
alt='$messageUtils.getMessage("velocity.macro.action.header.anonymous")'/>
</td>
<td id="header-text-container" valign="middle">
<p>
$messageUtils.getMessage('velocity.macro.action.header.anonymous')
</p>
</td>
#end
#break
#end
#end
<td class="header-text-container">
#if($authors.size() > $maxRenderedUsersCount )
#set($numberOftruncatedUsers = $authors.size() - $maxRenderedUsersCount)
$messageUtils.getMessage('velocity.macro.action.header.truncate.users', $numberOftruncatedUsers)
#end
<strong> $messageUtils.getMessage(
"velocity.macro.action.header.$jemhUtils.webhookEvent")</strong> $messageUtils.getMessage(
'velocity.macro.action.header.anIssue')
#if($jemhUtils.isCreatedByEmailUser() && false)
<strong>$messageUtils.getMessage('velocity.macro.action.header.byEmail')</strong>
#end
</td>
</tr>
#end
</table>
</td>
</tr>
#end
jemhIncludeBody Macro
Deprecated (old)
#macro ( jemhIncludeBody)
<tr>
<td class="email-content-main mobile-expand issue-description-container">
<table class="text-paragraph-pattern">
<tr>
<td class="text-paragraph-pattern-container mobile-resize-text">
#if ($jemhUtils.isCreateOrInChangeLog($context, 'description'))
$jemhUtils.setFieldRendered()
$jemhUtils.wikiToHtml($fields.description.textValue())