Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Email templates are velocity macro files. When email templates are used to render email body, the following Velocity context attributes are available.

 

Name
Type
Description
attachmentsManagercom.atlassian.jira.mail.util.MailAttachmentsManagerManager component
baseurlStringBase url of the JIRA instance, set under General Configuration
buildutilscom.atlassian.jira.util.BuildUtils 
customfieldManagercom.atlassian.jira.issue.CustomFieldManagerSupport for adding custom fields to outgoing emails
dateformattercom.atlassian.jira.web.util.OutlookDateDate format support
issuecom.atlassian.jira.mail.TemplateIssueIssue extended with support for processing in velocity templates
i18ncom.atlassian.jira.util.I18nHelperI18n support
jirakeyutilscom.atlassian.jira.util.JiraKeyUtils 
jirautilscom.atlassian.jira.util.JiraUtils 
remoteUsercom.atlassian.crowd.embedded.api.UserCurrent user running the action or null
rendererManagercom.atlassian.jira.issue.RendererManager 
stringUtilsorg.apache.commons.lang.StringUtilsString helper methods
textutilscom.opensymphony.util.TextUtilsJIRA's text util methods
userutilscom.atlassian.core.user.UserUtils 
velocityhelpercom.atlassian.velocity.VelocityHelper 
jetiFieldRenderer Support for field rendering in templates. See details below.
jetiFieldFormatter Support for date/time formatting in templates. See details below
numbercom.atlassian.jira.util.velocity.NumbertoolSupport for Number formatting in templates. See API documentation
currentUserInfo 

$!currentUserInfo.user: current user object
$!currentUserInfo.roles: current user's project roles
$!currentUserInfo.groups: current user's groups.

jetiFieldRenderer

FieldRenderer Interface
public interface FieldRenderer {
  String renderCustomField(Issue issue, String fieldKey);//
  String renderVersions(Collection<Version> versions);//
  String renderComponents(Collection<ProjectComponent> components);//
  String renderLabels(Collection<Label> labels);//
  String renderSecurityLevel(GenericValue securityLevel);//
  String renderIssueConstant(IssueConstant issueConstant);//
  String renderUser(User user);//
  String renderDateTime(Timestamp ts);//
  String renderEstimate(TemplateIssue ti, I18nHelper i18n);
  String renderRemainingEstimate(TemplateIssue ti, I18nHelper i18n);
  String renderWorklog(TemplateIssue ti, I18nHelper i18n);
  Object renderCustomFieldAsObject(Issue issue, String fieldKey);
  I18nHelper getI18nBean(String locale); //Returns a I18nBean for the given locale, locale string follows java syntax
}

jetiFieldFormatter

FieldFormatters Interface
public interface FieldFormatters {
 
//JIRA Date Formatting Options
  DateTimeFormatter getJiraDateTimeFormatter();
  DateTimeFormatter getJiraDateTimeFormatter(String styleName);
 
  String formatSafely(DateTimeFormatter dateFormat, Date value);
  String formatSafely(DateTimeFormatter dateFormat, Object value);
 
//Java Date Formatting Options
  DateFormat getJavaDateFormat();
  DateFormat getJavaDateFormat(int style);
  DateFormat getJavaDateFormat(int style, String locale);
  DateFormat getJavaDateTimeFormat();
  DateFormat getJavaDateTimeFormat(int dateStyle, int timeStyle);
  DateFormat getJavaDateTimeFormat(int dateStyle, int timeStyle, String locale);  
  DateFormat getJavaDateTimeFormat(String pattern);
  String formatSafely(DateFormat dateFormat, Object value);
  String formatSafely(DateFormat dateFormat, Date value);

}

 

  • No labels