/
Change the Content of a Template based on the Issues Project
Change the Content of a Template based on the Issues Project
Using Velocity Markup, the IssueEvent TemplateSets have access to $issue
so the project will be accessible, this is how content for example projects APP and AG can be used, with a default.
#if ($issue.project.key=="APP")
project APP stuff
#elseif ($issue.project.key=="AG")
project AG stuff
#else
default stuff
#end
For trivial content the above will work well, for larger more complex content, it may be more manageable to create a User Macro and call that instead:
User Macro
#macro ( exampleAPPContent )
Example APP content
#end
#macro ( exampleAGContent )
Example AG content
#end
#macro ( exampleDefaultContent )
Default Content
#end
Example TemplateSet content based on Macro calls
#if ($issue.project.key=="APP")
#exampleAPPContent()
#elseif ($issue.project.key=="AG")
#exampleAGContent()
#else
#exampleDefaultContent()
#end
User Macros
The User Macro editor has integrated testing so you can invoke macros and see the result as you edit (see pen icon, right of User Macro box):
User Macro Editor
Related articles
More details on Velocity at: http://velocity.apache.org/engine/devel/user-guide.html
Related content
Add the Last Issue Comment to Custom Notification Templates
Add the Last Issue Comment to Custom Notification Templates
Read with this
Working with issue custom fields in velocity
Working with issue custom fields in velocity
Read with this
Create an Ad-Hoc Template for "Notification Scheme Entity count exceeded" Notifications
Create an Ad-Hoc Template for "Notification Scheme Entity count exceeded" Notifications
Read with this
Change the EventID or Ignore an Event
Change the EventID or Ignore an Event
Read with this
Prevent /inhibit sending of a notification (Issue Event or Postfunction)
Prevent /inhibit sending of a notification (Issue Event or Postfunction)
Read with this
Configure Inbound Mail for JEMH
Configure Inbound Mail for JEMH
Read with this