Template System Version 2

 

The original template solution implemented for JEMHCloud was too simplistic as there was only one place to add macros.  The global macros were shared between all templates regardless of their look and feel. All macros including System/Custom and all themes ended up in one place, making it hard to maintain and extend.  We were aware of this issue and when we wanted to add a Service Desk theme - it was time to extend the solution. 

The new template system include one fundamental change to Themes.  Now, a Theme comprises of the HTML CSS Style and the Macros related to the Theme (like Jira, Generic and the newly added Service Desk Theme).  Related Template Sets of each event type (Issue Created, Updated, Deleted, etc.) share Style and Macros by sharing same Theme. 

JEMHCloud still uses System Macros and Custom Macros that are global, shared between all Themes.  In your custom global macros, you can have global macros like body delimiter and signatures.

Previewing Template Sets

There is a new way to see how a template will be rendered

  1. Go to Notifications->Preview

  2. Select the Template Set you want to preview. It can be either system or a custom one

  3. Select the Template Type to review either the html, text body or email subject

  4. Select a Preview Context.  Preview Context is an example of an JIRA event containing the issue and its changes. You can create Preview Context from real events in Auditing -> Events

  5. Check if you want to convert wiki markup in issue's description and comments into html

  6. Select your JIRA User recipient or leave it black to assume the recipient is an Email User.  How and what is shown in an email depends on the recipient (like role description and privacy)

  7. Change the language if you want to test translations.

  8. Hit Preview

 

JIRA theme's templates have been slightly improved.

Now, the $serviceJiraFields velocity variable holds the fields ids of the fields rendered in the email body. The variable can be dynamically updated through custom macros. 

Existing custom Template Sets and Themes have been patched (injecting old global macro content at the top of them). We highly recommend to revisit your custom templates.