Inject the current Notification Role into a message?

Scenario

You would like to inform users as to why they are receiving the notification, ie what Notification Scheme Entity is responsible (eg Reporter, Watchers).

Solution

Since JEMH 1.5.33


The following new (body) velocity context variable has been added:

$notificationSchemeEntity

This is of type SchemeEntity, and allows the following to be used in custom templates to get the name of the scheme entity:

#if ($!notificationSchemeEntity) ##to stop non-jira notifications receiving this content Hi, you are receiving this as you are referred through: "$notificationSchemeEntity.getType()". #end

 

Easy!