Class TemplateIssue
- All Implemented Interfaces:
WithId
,WithKey
,IssueContext
,Issue
,OfBizValueWrapper
,Serializable
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:
-
Field Summary
Fields inherited from interface com.atlassian.jira.issue.context.IssueContext
GLOBAL
Fields inherited from interface com.atlassian.jira.entity.WithId
ID_COMPARATOR
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateIssue
(Issue issue, FieldLayoutManager fieldLayoutManager, RendererManager rendererManager, CustomFieldManager customFieldManager, JiraDurationUtils jiraDurationUtils, AggregateTimeTrackingCalculatorFactory aggregateTimeTrackingCalculatorFactory) -
Method Summary
Modifier and TypeMethodDescriptionGet value for a custom field.Retrieves the html formatted description.Retrieves the html formatted environment.Return a formatted time string of the aggregate original time estimate.Return a formatted time string of the aggregate time estimate.Return a formatted time string of the aggregate time spent.Return a formatted time string of the time estimate.Return a formatted time string of the original time estimate.getNiceTimeSpent
(I18nHelper i18n) Return a formatted time string of the time spent.boolean
Are any of the aggregates different?void
store()
Persist this object's immediate fields.toString()
Methods inherited from class com.atlassian.jira.issue.GenericIssueWrapper
getAffectedVersions, getArchivedById, getArchivedByUser, getArchivedDate, getAssignee, getAssigneeId, getAssigneeUser, getAttachments, getComponentObjects, getComponents, getCreated, getCreator, getCreatorId, getCustomFieldValue, getDelegate, getDescription, getDueDate, getEnvironment, getEstimate, getExternalFieldValue, getFixVersions, getGenericValue, getId, getIssueRenderContext, getIssueType, getIssueTypeId, getIssueTypeObject, getKey, getLabels, getLong, getNumber, getOriginalEstimate, getParent, getParentId, getParentObject, getPriority, getPriorityObject, getProject, getProjectId, getProjectObject, getReporter, getReporterId, getReporterUser, getResolution, getResolutionDate, getResolutionId, getResolutionObject, getSecurityLevel, getSecurityLevelId, getStatus, getStatusId, getStatusObject, getString, getSubTaskObjects, getSubTasks, getSummary, getTimeSpent, getTimestamp, getUpdated, getVotes, getWatches, getWorkflowId, isArchived, isCreated, isEditable, isSubTask
-
Constructor Details
-
TemplateIssue
public TemplateIssue(Issue issue, FieldLayoutManager fieldLayoutManager, RendererManager rendererManager, CustomFieldManager customFieldManager, JiraDurationUtils jiraDurationUtils, AggregateTimeTrackingCalculatorFactory aggregateTimeTrackingCalculatorFactory)
-
-
Method Details
-
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
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
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
-
getAggregateRemainingEstimate
-
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 interfaceOfBizValueWrapper
- Overrides:
store
in classGenericIssueWrapper
-
getNiceTimeOriginalEstimate
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
Return a formatted time string of the time estimate.- Parameters:
i18n
- helper bean for internationalization- Returns:
- String formatted string of time estimate
-
getNiceTimeSpent
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
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
Return a formatted time string of the aggregate time estimate.- Parameters:
i18n
- helper bean for internationalization- Returns:
- String formatted string of time estimate
-
getNiceTimeAggregateTimeSpent
Return a formatted time string of the aggregate time spent.- Parameters:
i18n
- helper bean for internationalization- Returns:
- String formatted string of time spent
-
toString
-