JIRA 3.6 - Velocity Context for Email Templates

JIRA Documentation

Index

JIRA 3.6 introduced the TemplateContext and TemplateIssue objects into the Velocity context available for each email template.

The TemplateContext provides access to some general object references for use in the templates - e.g. Utilities,  Change Log details, etc.

The TemplateIssue provides access to the Issue object - further extended by helper methods for displaying information in rendered HTML format (i.e. environment, description and comments) and users who may not exist in the system. All issue related details can be retrieved from the TemplateIssue.

The following tables lists other objects that are also available within the context:

Velocity Varaible
JIRA Object/Value
Description
context com.atlassian.jira.mail.TemplateContext
The Template Context object itself
issue com.atlassian.jira.mail.TemplateIssue An Issue object with extended helper methods for display - this is the issue for which the email notification event was triggered
params java.util.Map Parameters of the IssueEvent that triggered this email notification
remoteUser com.opensymphony.user.User The user who has triggered this event
stringUtils org.apache.commons.lang.StringUtils Utility object providing formatting methods
padSize java.lang.Integer Used in text emails for padding the display
timeSpentFieldId java.lang.String The Id of the TimeSpentField - used in changelog for work logged notifications
attachments Collection(org.ofbiz.core.entity.GenericValue) Collection of Generic Values that represents the attachments associated with the issue
htmlComment java.lang.String The comment associated with this event as a rendered HTML formatted string. A basic string is returned if the comment cannot be rendered correctly - including links for any referenced JIRA issues.
comment java.lang.String The comment associated with this event as a plain string - used for text notifications.
commentauthor com.opensymphony.user.User The author of the comment 
visibilitylevel
java.lang.String
The security level of the comment
changelog org.ofbiz.core.entity.GenericValue The Generic value representing the changelog associated with the change
changelogauthor com.opensymphony.user.User The change log author
security org.ofbiz.core.entity.GenericValue The Generic value representing the security level, if any, associated with this issue
issue.htmlDescription java.lang.String
The HTML rendered description string - a basic string is returned if the comment cannot be rendered correctly - including links for any referenced JIRA issues.
issue.htmlEnvironment java.lang.String
The HTML rendered environment string - a basic string is returned if the comment cannot be rendered correctly - including links for any referenced JIRA issues.
recipient com.opensymphony.user.User
JIRA 3.6.1 onwards! The recipient of the email

Labels:

iira36 iira36 Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.