public class

IssueImpl

extends AbstractIssue
implements MutableIssue
java.lang.Object
   ↳ com.atlassian.jira.issue.AbstractIssue
     ↳ com.atlassian.jira.issue.IssueImpl

Class Overview

Issue implementation which caches read data, and can persist its data to the database (via an Ofbiz GenericValue.

Summary

[Expand]
Inherited Fields
From class com.atlassian.jira.issue.AbstractIssue
Public Constructors
IssueImpl(GenericValue genericValue, IssueManager issueManager, ProjectManager projectManager, VersionManager versionManager, IssueSecurityLevelManager issueSecurityLevelManager, ConstantsManager constantsManager, SubTaskManager subTaskManager, AttachmentManager attachmentManager, LabelManager labelManager, ProjectComponentManager projectComponentManager, UserManager userManager)
Load an issue backed by the database.
IssueImpl(Issue issue, IssueManager issueManager, ProjectManager projectManager, VersionManager versionManager, IssueSecurityLevelManager issueSecurityLevelManager, ConstantsManager constantsManager, SubTaskManager subTaskManager, AttachmentManager attachmentManager, LabelManager labelManager, ProjectComponentManager projectComponentManager, UserManager userManager)
Create an issue, cloning another issue's data.
Public Methods
boolean equals(Object o)
Collection<Version> getAffectedVersions()
User getAssignee()
Returns the Assignee User.
String getAssigneeId()
User getAssigneeUser()
Returns the Assignee User.
Collection<ProjectComponent> getComponentObjects()
Collection<GenericValue> getComponents()
Timestamp getCreated()
Object getCustomFieldValue(CustomField customField)
String getDescription()
Timestamp getDueDate()
String getEnvironment()
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.
Long getId()
static MutableIssue getIssueObject(GenericValue genericValue)
This method is deprecated. You should construct this yourself if at all possible, or use getIssue(org.ofbiz.core.entity.GenericValue) instead.
IssueRenderContext getIssueRenderContext()
GenericValue getIssueType()
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.
Map<StringModifiedValue> getModifiedFields()
Retrieve a map of issue fields whose values have been set (since object creation or last resetModifiedFields() call.
Long getOriginalEstimate()
This is the "original estimate" of work to be performed on this issue, in milliseconds.
GenericValue getParent()
This method is deprecated. Use getParentObject() instead.
Long getParentId()
Issue getParentObject()
If this issue is a subtask, return its parent.
GenericValue getPriority()
Returns the Priority for this Issue.
GenericValue getProject()
Gets the Project for this IssueContext.
Project getProjectObject()
Gets the Project for this Issue.
User getReporter()
Returns the Reporter User.
String getReporterId()
User getReporterUser()
Returns the Reporter User.
GenericValue getResolution()
Returns the Resolution for this Issue.
Timestamp getResolutionDate()
Returns the datetime that an issue was resolved on.
String getResolutionId()
GenericValue getSecurityLevel()
Returns the Security Level for this Issue.
Long getSecurityLevelId()
Returns the Security Level for this Issue.
GenericValue getStatus()
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()
int hashCode()
boolean isCreated()
boolean isSubTask()
void resetModifiedFields()
Reset the internal list of modified fields.
void setAffectedVersions(Collection<Version> affectedVersions)
void setAssignee(User assignee)
void setAssigneeId(String assigneeKey)
Sets the user that this issue is assigned to.
void setComponentObjects(Collection<ProjectComponent> components)
Sets the components for this Issue.
void setComponents(Collection<GenericValue> components)
Sets the components for this Issue.
void setCreated(Timestamp created)
void setCustomFieldValue(CustomField customField, Object value)
Sets a custom field value on this Issue Object, but does not write it to the database.
void setDescription(String description)
void setDueDate(Timestamp dueDate)
void setEnvironment(String environment)
void setEstimate(Long estimate)
void setExternalFieldValue(String fieldId, Object newValue)
This can be used bya field to "place" a custom object into the MutableIssue so that it can retrived it by key at a later point via the getModifiedFields() and getExternalFieldValue(String).
void setExternalFieldValue(String fieldId, Object oldValue, Object newValue)
This can be used bya field to "place" a custom object into the MutableIssue so that it can retrived it by key at a later point via the getModifiedFields() and getExternalFieldValue(String).
void setFixVersions(Collection<Version> fixVersions)
void setIssueType(GenericValue issueType)
Sets the IssueType for this Issue.
void setIssueTypeId(String issueTypeId)
Set the issue type, by type id.
void setIssueTypeObject(IssueType issueType)
Sets the IssueType for this Issue.
void setKey(String key)
void setLabels(Set<Label> labels)
Set the labels for this issue.
void setOriginalEstimate(Long originalEstimate)
void setParentId(Long parentId)
Sets the ParentId of this Issue.
void setParentObject(Issue parentIssue)
Sets the parent Issue Object for this Issue (subtask).
void setPriority(GenericValue priority)
Sets the priority for this Issue.
void setPriorityId(String priorityId)
void setPriorityObject(Priority priority)
Sets the priority for this Issue.
void setProject(GenericValue project)
Sets the Project for this Issue.
void setProjectId(Long projectId)
Sets the project by id.
void setProjectObject(Project project)
Sets the Project for this Issue.
void setReporter(User reporter)
void setReporterId(String reporterId)
Sets the reporter in this issue.
void setResolution(GenericValue resolution)
Sets the resolution for this Issue.
void setResolutionDate(Timestamp resolutionDate)
void setResolutionId(String resolutionId)
void setResolutionObject(Resolution resolution)
Sets the resolution for this Issue.
void setSecurityLevel(GenericValue securityLevel)
Sets the SecurityLevel for this Issue.
void setSecurityLevelId(Long securityLevelId)
Sets the SecurityLevel for this Issue.
void setStatus(GenericValue status)
Sets the status for this Issue.
void setStatusId(String statusId)
Set issue's status by status id ("1", "2" etc).
void setStatusObject(Status status)
Sets the status for this Issue.
void setSummary(String summary)
void setTimeSpent(Long timespent)
void setUpdated(Timestamp updated)
void setVotes(Long votes)
void setWatches(Long watches)
void setWorkflowId(Long workflowId)
void store()
Persist this object's immediate fields.
String toString()
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.AbstractIssue
From class java.lang.Object
From interface com.atlassian.jira.issue.Issue
From interface com.atlassian.jira.issue.MutableIssue
From interface com.atlassian.jira.issue.context.IssueContext
From interface com.atlassian.jira.ofbiz.OfBizValueWrapper

Public Constructors

public IssueImpl (GenericValue genericValue, IssueManager issueManager, ProjectManager projectManager, VersionManager versionManager, IssueSecurityLevelManager issueSecurityLevelManager, ConstantsManager constantsManager, SubTaskManager subTaskManager, AttachmentManager attachmentManager, LabelManager labelManager, ProjectComponentManager projectComponentManager, UserManager userManager)

Load an issue backed by the database.

Parameters
genericValue generic value of the issue
issueManager issue manager
projectManager project manager
versionManager version manager
issueSecurityLevelManager issue security level manager
constantsManager constant manager
subTaskManager sub-task manager
attachmentManager attachment manager
labelManager label manager
projectComponentManager project component manager
userManager user manager

public IssueImpl (Issue issue, IssueManager issueManager, ProjectManager projectManager, VersionManager versionManager, IssueSecurityLevelManager issueSecurityLevelManager, ConstantsManager constantsManager, SubTaskManager subTaskManager, AttachmentManager attachmentManager, LabelManager labelManager, ProjectComponentManager projectComponentManager, UserManager userManager)

Create an issue, cloning another issue's data.

Parameters
issue issue
issueManager issue manager
projectManager project manager
versionManager version manager
issueSecurityLevelManager issue security level manager
constantsManager constant manager
subTaskManager sub-task manager
attachmentManager attachment manager
labelManager label manager
projectComponentManager project component manager
userManager user manager

Public Methods

public boolean equals (Object o)

public Collection<Version> getAffectedVersions ()

public User 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 User 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<ProjectComponent> getComponentObjects ()

public Collection<GenericValue> getComponents ()

public Timestamp getCreated ()

public Object getCustomFieldValue (CustomField customField)

public String getDescription ()

public Timestamp getDueDate ()

public String getEnvironment ()

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 Long getId ()

public static MutableIssue getIssueObject (GenericValue genericValue)

This method is deprecated.
You should construct this yourself if at all possible, or use getIssue(org.ofbiz.core.entity.GenericValue) instead.

This is a static way of instantiating an Issue Object.

Parameters
genericValue generic value of the issue
Returns
  • new instance of MutableIssue

public IssueRenderContext getIssueRenderContext ()

public GenericValue getIssueType ()

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 Map<StringModifiedValue> getModifiedFields ()

Retrieve a map of issue fields whose values have been set (since object creation or last resetModifiedFields() call.

Returns
  • A Map of key -> ModifiedValue pairs, where keys are defined in IssueFieldConstants and the value objects in the ModifiedValue are field-specific.

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 ()

This method is deprecated.
Use getParentObject() instead.

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 GenericValue getPriority ()

Returns the Priority for this Issue.

Returns
  • the Priority for this Issue.

public GenericValue getProject ()

Gets the Project for this IssueContext.

A null return value is used to represent that this context applies to all Projects.

Returns
  • The Project for this IssueContext (can be null).

public Project getProjectObject ()

Gets the Project for this Issue.

Returns
  • The Project for this Issue.

public User 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 User getReporterUser ()

Returns the Reporter User.

This will return a non-null User object even if the User has been deleted.

Legacy synonym for getReporter().

Returns
  • the Reporter User.

public GenericValue 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 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 GenericValue getStatus ()

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 int hashCode ()

public boolean isCreated ()

public boolean isSubTask ()

public void resetModifiedFields ()

Reset the internal list of modified fields.

public void setAffectedVersions (Collection<Version> affectedVersions)

public void setAssignee (User assignee)

public void setAssigneeId (String assigneeKey)

Sets the user that this issue is assigned to. Note that this should be the userkey, not the username.

Parameters
assigneeKey The user key.

public void setComponentObjects (Collection<ProjectComponent> components)

Sets the components for this Issue.

Parameters
components the new components value

public void setComponents (Collection<GenericValue> components)

Sets the components for this Issue.

Parameters
components the new components value

public void setCreated (Timestamp created)

public void setCustomFieldValue (CustomField customField, Object value)

Sets a custom field value on this Issue Object, but does not write it to the database. This is highly misleading.
To actually set a custom field value, use updateIssue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, MutableIssue, java.util.Map)

Parameters
customField the CustomField
value the value.

public void setDescription (String description)

public void setDueDate (Timestamp dueDate)

public void setEnvironment (String environment)

public void setEstimate (Long estimate)

public void setExternalFieldValue (String fieldId, Object newValue)

This can be used bya field to "place" a custom object into the MutableIssue so that it can retrived it by key at a later point via the getModifiedFields() and getExternalFieldValue(String).

The passed in newValue will be wrapped in the getNewValue() The getOldValue() will be null.

Parameters
fieldId the field id to use as a key
newValue the new value to place in a ModifiedValue

public void setExternalFieldValue (String fieldId, Object oldValue, Object newValue)

This can be used bya field to "place" a custom object into the MutableIssue so that it can retrived it by key at a later point via the getModifiedFields() and getExternalFieldValue(String).

The passed in newValue will be wrapped in the getNewValue() and the oldValue will be placed in getOldValue()

Parameters
fieldId the field id to use as a key
oldValue the old value to place in a ModifiedValue
newValue the new value to place in a ModifiedValue

public void setFixVersions (Collection<Version> fixVersions)

public void setIssueType (GenericValue issueType)

Sets the IssueType for this Issue.

Parameters
issueType the new IssueType

public void setIssueTypeId (String issueTypeId)

Set the issue type, by type id.

public void setIssueTypeObject (IssueType issueType)

Sets the IssueType for this Issue.

Parameters
issueType the new IssueType

public void setKey (String key)

public void setLabels (Set<Label> labels)

Set the labels for this issue.

Parameters
labels the labels for this issue

public void setOriginalEstimate (Long originalEstimate)

public void setParentId (Long parentId)

Sets the ParentId of this Issue.

Parameters
parentId The new parentId.

public void setParentObject (Issue parentIssue)

Sets the parent Issue Object for this Issue (subtask).

Normally a subtask just has the ID of the parent set using setParentId(). In this case, the getParentObject() method will look up the parent object from the DB (or cache). However, when you are editing a parent and its subtask within a transaction (eg a Bulk Move), it is useful to be able to link the subtask to the pending parent object in order that it can see the new values for the parent.

Parameters
parentIssue the required parent Issue for this subtask.

public void setPriority (GenericValue priority)

Sets the priority for this Issue.

Parameters
priority the new priority value

public void setPriorityId (String priorityId)

public void setPriorityObject (Priority priority)

Sets the priority for this Issue.

Parameters
priority the new priority value

public void setProject (GenericValue project)

Sets the Project for this Issue.

Parameters
project the new Project

public void setProjectId (Long projectId)

Sets the project by id. This has the same outcome as calling setProject(org.ofbiz.core.entity.GenericValue)

Parameters
projectId The id of the project

public void setProjectObject (Project project)

Sets the Project for this Issue.

Parameters
project the new Project

public void setReporter (User reporter)

public void setReporterId (String reporterId)

Sets the reporter in this issue. Note that this should be the userkey, not the username.

Parameters
reporterId userkey of the desired reporter.

public void setResolution (GenericValue resolution)

Sets the resolution for this Issue.

Parameters
resolution the new resolution value

public void setResolutionDate (Timestamp resolutionDate)

public void setResolutionId (String resolutionId)

public void setResolutionObject (Resolution resolution)

Sets the resolution for this Issue.

Parameters
resolution the new resolution value

public void setSecurityLevel (GenericValue securityLevel)

Sets the SecurityLevel for this Issue.

Parameters
securityLevel the new SecurityLevel value

public void setSecurityLevelId (Long securityLevelId)

Sets the SecurityLevel for this Issue.

Parameters
securityLevelId the new SecurityLevel value

public void setStatus (GenericValue status)

Sets the status for this Issue.

Parameters
status the new status value

public void setStatusId (String statusId)

Set issue's status by status id ("1", "2" etc).

Parameters
statusId the new StatusId.

public void setStatusObject (Status status)

Sets the status for this Issue.

Parameters
status the new status value

public void setSummary (String summary)

public void setTimeSpent (Long timespent)

public void setUpdated (Timestamp updated)

public void setVotes (Long votes)

public void setWatches (Long watches)

public void setWorkflowId (Long workflowId)

public void store ()

Persist this object's immediate fields.

public String toString ()