public class

TemplateIssue

extends Object
implements Issue
java.lang.Object
   ↳ com.atlassian.jira.mail.TemplateIssue

Class Overview

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

Summary

[Expand]
Inherited Fields
From interface com.atlassian.jira.entity.WithId
From interface com.atlassian.jira.issue.context.IssueContext
Public Constructors
TemplateIssue(Issue issue, FieldLayoutManager fieldLayoutManager, RendererManager rendererManager, CustomFieldManager customFieldManager, JiraDurationUtils jiraDurationUtils, AggregateTimeTrackingCalculatorFactory aggregateTimeTrackingCalculatorFactory)
Public Methods
Collection<Version> getAffectedVersions()
Long getAggregateOriginalEstimate()
Long getAggregateRemainingEstimate()
Long getAggregateTimeSpent()
ApplicationUser getAssignee()
Returns the Assignee User.
String getAssigneeId()
ApplicationUser getAssigneeUser()
Returns the Assignee User.
Collection<Attachment> getAttachments()
Collection<ProjectComponent> getComponentObjects()
This method is deprecated. Use getComponents(). Since v7.0
Collection<ProjectComponent> getComponents()
Timestamp getCreated()
ApplicationUser getCreator()
String getCreatorId()
CustomField getCustomField(String id)
Object getCustomFieldValue(String id)
Get value for a custom field.
Object getCustomFieldValue(CustomField customField)
String getDescription()
Retrieve the description of the issue.
Timestamp getDueDate()
String getEnvironment()
Retrieve the environment of the issue.
Long getEstimate()
This is the "remaining estimate" of work left to be performed on this issue, in milliseconds.
Object getExternalFieldValue(String fieldId)
Collection<Version> getFixVersions()
GenericValue getGenericValue()
Get the backing GenericValue object.
String getHtmlDescription()
Retrieves the html formatted description.
String getHtmlEnvironment()
Retrieves the html formatted environment.
Long getId()
IssueRenderContext getIssueRenderContext()
IssueType getIssueType()
Gets the IssueType for this Issue.
String getIssueTypeId()
Gets the ID of the IssueType for this Issue.
IssueType getIssueTypeObject()
Gets the IssueType for this Issue.
String getKey()
Set<Label> getLabels()
Returns a set of all the labels for this issue or an empty set if none exist yet.
Long getLong(String name)
Retrieve a numeric field.
String getNiceTimeAggregateOriginalEstimate(I18nHelper i18n)
Return a formatted time string of the aggregate original time estimate.
String getNiceTimeAggregateRemainingEstimate(I18nHelper i18n)
Return a formatted time string of the aggregate time estimate.
String getNiceTimeAggregateTimeSpent(I18nHelper i18n)
Return a formatted time string of the aggregate time spent.
String getNiceTimeEstimate(I18nHelper i18n)
Return a formatted time string of the time estimate.
String getNiceTimeOriginalEstimate(I18nHelper i18n)
Return a formatted time string of the original time estimate.
String getNiceTimeSpent(I18nHelper i18n)
Return a formatted time string of the time spent.
Long getNumber()
Long getOriginalEstimate()
This is the "original estimate" of work to be performed on this issue, in milliseconds.
GenericValue getParent()
Long getParentId()
Issue getParentObject()
If this issue is a subtask, return its parent.
Priority getPriority()
Returns the Priority for this Issue.
Priority getPriorityObject()
Returns the Priority for this Issue.
GenericValue getProject()
Long getProjectId()
Gets the ID of the Project for this Issue.
Project getProjectObject()
Gets the Project for this Issue.
ApplicationUser getReporter()
Returns the Reporter User.
String getReporterId()
ApplicationUser getReporterUser()
Return the reporter - an object will be returned even if the user has been deleted from the system.
Resolution getResolution()
Returns the Resolution for this Issue.
Timestamp getResolutionDate()
Returns the datetime that an issue was resolved on.
String getResolutionId()
Resolution getResolutionObject()
Returns the Resolution for this Issue.
GenericValue getSecurityLevel()
Returns the Security Level for this Issue.
Long getSecurityLevelId()
Returns the Security Level for this Issue.
Status getStatus()
String getStatusId()
Status getStatusObject()
String getString(String name)
Retrieve a String field.
Collection<Issue> getSubTaskObjects()
Gets all the issue's subtasks.
Collection<GenericValue> getSubTasks()
String getSummary()
Long getTimeSpent()
This is the "total time spent" working on this issue, in milliseconds.
Timestamp getTimestamp(String name)
Retrieve a timestamp field.
Timestamp getUpdated()
Long getVotes()
Long getWatches()
Long getWorkflowId()
boolean isAnyAggregateDifferent()
Are any of the aggregates different?
boolean isCreated()
boolean isEditable()
boolean isSubTask()
void store()
Persist this object's immediate fields.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.entity.WithId
From interface com.atlassian.jira.entity.WithKey
From interface com.atlassian.jira.issue.Issue
From interface com.atlassian.jira.issue.context.IssueContext
From interface com.atlassian.jira.ofbiz.OfBizValueWrapper

Public Constructors

public TemplateIssue (Issue issue, FieldLayoutManager fieldLayoutManager, RendererManager rendererManager, CustomFieldManager customFieldManager, JiraDurationUtils jiraDurationUtils, AggregateTimeTrackingCalculatorFactory aggregateTimeTrackingCalculatorFactory)

Public Methods

public Collection<Version> getAffectedVersions ()

public Long getAggregateOriginalEstimate ()

public Long getAggregateRemainingEstimate ()

public Long getAggregateTimeSpent ()

public ApplicationUser getAssignee ()

Returns the Assignee User.

Warning: previous incarnations of this method returned com.opensymphony.user.User. This class has now been removed from the JIRA API, meaning that the 5.0 version is not binary or source compatible with earlier versions.

Returns
  • the Assignee User.

public String getAssigneeId ()

public ApplicationUser getAssigneeUser ()

Returns the Assignee User.

If there is no assignee it returns null, else it is guaranteed to return a non-null User. If the User is no longer available, it will create a dummy User object based on the username.

Legacy synonym for getAssignee()

Returns
  • the Assignee User.

public Collection<Attachment> getAttachments ()

public Collection<ProjectComponent> getComponentObjects ()

This method is deprecated.
Use getComponents(). Since v7.0

Returns
  • list of project components

public Collection<ProjectComponent> getComponents ()

public Timestamp getCreated ()

public ApplicationUser getCreator ()

public String getCreatorId ()

public CustomField getCustomField (String id)

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.

public Object getCustomFieldValue (CustomField customField)

public String getDescription ()

Retrieve the description of the issue.

Returns
  • String the issue description - rendered or text dependant on format

public Timestamp getDueDate ()

public String getEnvironment ()

Retrieve the environment of the issue. Depending on the format specified - attempt to return the rendered description or the simple text

Returns
  • String the issue environment - rendered or text dependant on format specified

public Long getEstimate ()

This is the "remaining estimate" of work left to be performed on this issue, in milliseconds.

A better name would be getRemainingEstimate but for historical reasons it is called what it is called.

Returns
  • the "remaining estimate" of work left to be performed on this issue, in milliseconds.

public Object getExternalFieldValue (String fieldId)

public Collection<Version> getFixVersions ()

public GenericValue getGenericValue ()

Get the backing GenericValue object.

Returns
  • the backing GenericValue object.

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.

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.

public Long getId ()

public IssueRenderContext getIssueRenderContext ()

public IssueType getIssueType ()

Gets the IssueType for this Issue.

Returns
  • The IssueType for this Issue.

public String getIssueTypeId ()

Gets the ID of the IssueType for this Issue.

Returns
  • The ID of the IssueType for this Issue.

public IssueType getIssueTypeObject ()

Gets the IssueType for this Issue.

Returns
  • The IssueType for this Issue.

public String getKey ()

public Set<Label> getLabels ()

Returns a set of all the labels for this issue or an empty set if none exist yet.

Returns
  • a set of all the labels for this issue or an empty set if none exist yet

public Long getLong (String name)

Retrieve a numeric field.

Parameters
name the field name
Returns
  • the value for the given field.

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

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

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

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

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

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

public Long getNumber ()

public Long getOriginalEstimate ()

This is the "original estimate" of work to be performed on this issue, in milliseconds.

Returns
  • the "original estimate" of work to be performed on this issue, in milliseconds.

public GenericValue getParent ()

public Long getParentId ()

public Issue getParentObject ()

If this issue is a subtask, return its parent.

Returns
  • The parent Issue, or null if the issue is not a subtask.

public Priority getPriority ()

Returns the Priority for this Issue.

Returns
  • the Priority for this Issue.

public Priority getPriorityObject ()

Returns the Priority for this Issue.

Returns
  • the Priority for this Issue.

public GenericValue getProject ()

public Long getProjectId ()

Gets the ID of the Project for this Issue.

Returns
  • The ID of the Project for this Issue.

public Project getProjectObject ()

Gets the Project for this Issue.

Returns
  • The Project for this Issue.

public ApplicationUser getReporter ()

Returns the Reporter User.

Warning: previous incarnations of this method returned com.opensymphony.user.User. This class has now been removed from the JIRA API, meaning that the 5.0 version is not binary or source compatible with earlier versions.

Returns
  • the Reporter User.

public String getReporterId ()

public ApplicationUser getReporterUser ()

Return the reporter - an object will be returned even if the user has been deleted from the system.

Returns
  • Object a User or DummyUser object if the issue has an reporter

public Resolution getResolution ()

Returns the Resolution for this Issue.

Returns
  • the Resolution for this Issue.

public Timestamp getResolutionDate ()

Returns the datetime that an issue was resolved on. Will be null if it hasn't been resolved yet, or if an issue has been returned to the 'unresolved' state.

Returns
  • Timestamp of when an issue was resolved, or null

public String getResolutionId ()

public Resolution getResolutionObject ()

Returns the Resolution for this Issue.

Returns
  • the Resolution for this Issue.

public GenericValue getSecurityLevel ()

Returns the Security Level for this Issue.

Returns
  • the Security Level for this Issue.

public Long getSecurityLevelId ()

Returns the Security Level for this Issue.

Returns
  • the Security Level for this Issue.

public Status getStatus ()

public String getStatusId ()

public Status getStatusObject ()

public String getString (String name)

Retrieve a String field.

Parameters
name the field name
Returns
  • the value for the given field.

public Collection<Issue> getSubTaskObjects ()

Gets all the issue's subtasks.

Returns

public Collection<GenericValue> getSubTasks ()

public String getSummary ()

public Long getTimeSpent ()

This is the "total time spent" working on this issue, in milliseconds.

Returns
  • the "total time spent" working on this issue, in milliseconds.

public Timestamp getTimestamp (String name)

Retrieve a timestamp field.

Parameters
name the field name
Returns
  • the value for the given field.

public Timestamp getUpdated ()

public Long getVotes ()

public Long getWatches ()

public Long getWorkflowId ()

public boolean isAnyAggregateDifferent ()

Are any of the aggregates different?

Returns
  • true if any of the aggregate time tracking values are different, false otherwise

public boolean isCreated ()

public boolean isEditable ()

public boolean isSubTask ()

public void store ()

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.

public String toString ()