Class TemplateIssue

java.lang.Object
com.atlassian.jira.issue.GenericIssueWrapper
com.atlassian.jira.mail.TemplateIssue
All Implemented Interfaces:
WithId, WithKey, IssueContext, Issue, OfBizValueWrapper, Serializable

public class TemplateIssue extends GenericIssueWrapper
Decorator for the Issue Object.

This class will ensure backwards compatibility for templates accessing the issue object. This class also includes helper methods for retrieving rendered fields (e.g. description, environment) and nicely formatted date fields (e.g. Original Time Estimate, Time Spent, etc.).

This object is passed to the template through the TemplateContext for the velocity email templates

See Also:
  • Constructor Details

  • Method Details

    • getHtmlDescription

      public String getHtmlDescription()
      Retrieves the html formatted description.

      A simple string (with linked bug keys displayed) is returned if a rendered version cannot be generated.

      Returns:
      String the html formatted description.
    • getHtmlEnvironment

      public String getHtmlEnvironment()
      Retrieves the html formatted environment.

      A simple string (with linked bug keys displayed) is returned if a rendered version cannot be generated.

      Returns:
      String the html formatted environment.
    • getCustomFieldValue

      public Object getCustomFieldValue(String id)
      Get value for a custom field.
      Parameters:
      id - Custom field key (eg. 'customfield_10010').
      Returns:
      custom field, or null if specified custom field doesn't exist or doesn't have a value in this issue.
    • getAggregateOriginalEstimate

      public Long getAggregateOriginalEstimate()
    • getAggregateRemainingEstimate

      public Long getAggregateRemainingEstimate()
    • getAggregateTimeSpent

      public Long getAggregateTimeSpent()
    • store

      public void store()
      Description copied from interface: OfBizValueWrapper
      Persist this object's immediate fields.

      As of JIRA 7.0 this method is considered optional. If this object is actually immutable, then it will throw UnsupportedOperationException because there are no possible mutations to store.

      Specified by:
      store in interface OfBizValueWrapper
      Overrides:
      store in class GenericIssueWrapper
    • getNiceTimeOriginalEstimate

      public String getNiceTimeOriginalEstimate(I18nHelper i18n)
      Return a formatted time string of the original time estimate.
      Parameters:
      i18n - helper bean for internationalization
      Returns:
      String formatted string of original time estimate
    • getNiceTimeEstimate

      public String getNiceTimeEstimate(I18nHelper i18n)
      Return a formatted time string of the time estimate.
      Parameters:
      i18n - helper bean for internationalization
      Returns:
      String formatted string of time estimate
    • getNiceTimeSpent

      public String getNiceTimeSpent(I18nHelper i18n)
      Return a formatted time string of the time spent.
      Parameters:
      i18n - helper bean for internationalization
      Returns:
      String formatted string of time spent
    • isAnyAggregateDifferent

      public boolean isAnyAggregateDifferent()
      Are any of the aggregates different?
      Returns:
      true if any of the aggregate time tracking values are different, false otherwise
    • getNiceTimeAggregateOriginalEstimate

      public String getNiceTimeAggregateOriginalEstimate(I18nHelper i18n)
      Return a formatted time string of the aggregate original time estimate.
      Parameters:
      i18n - helper bean for internationalization
      Returns:
      String formatted string of original time estimate
    • getNiceTimeAggregateRemainingEstimate

      public String getNiceTimeAggregateRemainingEstimate(I18nHelper i18n)
      Return a formatted time string of the aggregate time estimate.
      Parameters:
      i18n - helper bean for internationalization
      Returns:
      String formatted string of time estimate
    • getNiceTimeAggregateTimeSpent

      public String getNiceTimeAggregateTimeSpent(I18nHelper i18n)
      Return a formatted time string of the aggregate time spent.
      Parameters:
      i18n - helper bean for internationalization
      Returns:
      String formatted string of time spent
    • toString

      public String toString()
      Overrides:
      toString in class Object