Package com.atlassian.jira.issue
Interface MutableIssue
- All Superinterfaces:
Issue
,IssueContext
,OfBizValueWrapper
,Serializable
,WithId
,WithKey
- All Known Implementing Classes:
GenericMutableIssueWrapper
,IssueImpl
,MockIssue
Facade for an issue's
GenericValue
. After calling any 'setter' method, you will need to call store()
to persist the change to the database. Note that this is a 'shallow' store - only fields directly part of the issue
(in the database schema) are persisted.- 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
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve a map of issue fields whose values have been set (since object creation or lastresetModifiedFields()
call.void
Reset the internal list of modified fields.void
setAffectedVersions
(Collection<Version> affectedVersions) void
setArchived
(boolean isArchived) void
setAssignee
(ApplicationUser assignee) void
setAssigneeId
(String assigneeId) Sets the user that this issue is assigned to.void
setComponent
(Collection<ProjectComponent> 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 by a field to "place" a custom object into the MutableIssue so that it can be retrieved by key at a later point via thegetModifiedFields()
andIssue.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 be retrieved by key at a later point via thegetModifiedFields()
andIssue.getExternalFieldValue(String)
.void
setFixVersions
(Collection<Version> fixVersions) void
setIssueType
(IssueType issueType) void
setIssueTypeId
(String issueTypeId) void
setIssueTypeObject
(IssueType issueType) Sets the IssueType for this Issue.void
Deprecated.void
Set the labels for this issue.void
void
setOriginalEstimate
(Long estimate) 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
(Priority priority) Sets the priority for this Issue.void
setPriorityId
(String priorityId) Sets the priority for this Issue.void
setPriorityObject
(Priority priority) Sets the priority for this Issue.void
setProject
(org.ofbiz.core.entity.GenericValue project) Deprecated.UsesetProjectObject(com.atlassian.jira.project.Project)
instead.void
setProjectId
(Long projectId) Sets the project by id.void
setProjectObject
(Project project) Sets the Project for this Issue.void
setReporter
(ApplicationUser reporter) void
setReporterId
(String reporterId) Sets the reporter in this issue.void
setResolution
(Resolution 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
(org.ofbiz.core.entity.GenericValue securityLevel) Deprecated.UsesetSecurityLevelId(Long)
instead.void
setSecurityLevelId
(Long securityLevelId) Sets the SecurityLevel for this Issue.void
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
void
setWatches
(Long votes) void
setWorkflowId
(Long workflowId) void
store()
Deprecated.Use the Object's Service or Manager to save values.Methods inherited from interface com.atlassian.jira.issue.Issue
equals, getAffectedVersions, getArchivedById, getArchivedByUser, getArchivedDate, getAssignee, getAssigneeId, getAssigneeUser, getAttachments, getComponentObjects, getComponents, getCreated, getCreator, getCreatorId, getCustomFieldValue, getDescription, getDueDate, getEnvironment, getEstimate, getExternalFieldValue, getFixVersions, getGenericValue, getId, getIssueRenderContext, getIssueType, getIssueTypeId, getIssueTypeObject, getKey, getLabels, getNumber, getOriginalEstimate, getParent, getParentId, getParentObject, getPriority, getPriorityObject, getProject, getProjectId, getProjectObject, getReporter, getReporterId, getReporterUser, getResolution, getResolutionDate, getResolutionId, getResolutionObject, getSecurityLevel, getSecurityLevelId, getStatus, getStatusId, getStatusObject, getSubTaskObjects, getSubTasks, getSummary, getTimeSpent, getUpdated, getVotes, getWatches, getWorkflowId, hashCode, isArchived, isCreated, isEditable, isSubTask
Methods inherited from interface com.atlassian.jira.ofbiz.OfBizValueWrapper
getLong, getString, getTimestamp
-
Method Details
-
setProject
void setProject(org.ofbiz.core.entity.GenericValue project) Deprecated.UsesetProjectObject(com.atlassian.jira.project.Project)
instead. Since v5.0.Sets the Project for this Issue.- Parameters:
project
- the new Project
-
setProjectObject
Sets the Project for this Issue.- Parameters:
project
- the new Project
-
setProjectId
Sets the project by id.- Parameters:
projectId
- The id of the project- Throws:
IllegalArgumentException
- If no project exists for the given projectId.
-
setIssueType
-
setIssueTypeObject
Sets the IssueType for this Issue.- Parameters:
issueType
- the new IssueType
-
setIssueTypeId
-
setSummary
-
setAssignee
-
setComponent
Sets the components for this Issue.- Parameters:
components
- the new components value- Since:
- v5.0
-
setAssigneeId
Sets the user that this issue is assigned to. Note that this should be the userkey, not the username.- Parameters:
assigneeId
- The user key.
-
setReporter
-
setReporterId
Sets the reporter in this issue. Note that this should be the userkey, not the username.- Parameters:
reporterId
- userkey of the desired reporter.- See Also:
-
setDescription
-
setEnvironment
-
setAffectedVersions
- Parameters:
affectedVersions
- A collection of 'affects'Version
objects.
-
setFixVersions
- Parameters:
fixVersions
- A collection of fix-forVersion
objects.
-
setDueDate
-
setSecurityLevelId
Sets the SecurityLevel for this Issue.- Parameters:
securityLevelId
- the new SecurityLevel value
-
setSecurityLevel
void setSecurityLevel(org.ofbiz.core.entity.GenericValue securityLevel) Deprecated.UsesetSecurityLevelId(Long)
instead. Since v5.0.Sets the SecurityLevel for this Issue.- Parameters:
securityLevel
- the new SecurityLevel value
-
setPriority
Sets the priority for this Issue.- Parameters:
priority
- the new priority value
-
setPriorityObject
Sets the priority for this Issue.- Parameters:
priority
- the new priority value
-
setPriorityId
Sets the priority for this Issue.- Parameters:
priorityId
- the new priority value
-
setResolution
Sets the resolution for this Issue. -
setResolutionObject
Sets the resolution for this Issue.- Parameters:
resolution
- the new resolution value
-
setKey
Deprecated.UsesetProjectObject(com.atlassian.jira.project.Project)
andsetNumber(Long)
to change issue. Since v6.1- Parameters:
key
-
-
setNumber
-
setVotes
-
setWatches
-
setCreated
-
setUpdated
-
setResolutionDate
-
setWorkflowId
-
setCustomFieldValue
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, useOrderableField.updateIssue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, MutableIssue, java.util.Map)
- Parameters:
customField
- the CustomFieldvalue
- the value.
-
setStatus
Sets the status for this Issue.- Parameters:
status
- the new status value
-
setStatusObject
Sets the status for this Issue.- Parameters:
status
- the new status value
-
setStatusId
Set issue's status by status id ("1", "2" etc).- Parameters:
statusId
- the new StatusId.
-
resetModifiedFields
void resetModifiedFields()Reset the internal list of modified fields.- See Also:
-
setOriginalEstimate
-
setTimeSpent
-
setEstimate
-
setExternalFieldValue
This can be used by a field to "place" a custom object into the MutableIssue so that it can be retrieved by key at a later point via thegetModifiedFields()
andIssue.getExternalFieldValue(String)
.The passed in newValue will be wrapped in the
ModifiedValue.getNewValue()
TheModifiedValue.getOldValue()
will be null.- Parameters:
fieldId
- the field id to use as a keynewValue
- the new value to place in aModifiedValue
-
setExternalFieldValue
This can be used bya field to "place" a custom object into the MutableIssue so that it can be retrieved by key at a later point via thegetModifiedFields()
andIssue.getExternalFieldValue(String)
.The passed in newValue will be wrapped in the
ModifiedValue.getNewValue()
and the oldValue will be placed inModifiedValue.getOldValue()
- Parameters:
fieldId
- the field id to use as a keyoldValue
- the old value to place in aModifiedValue
newValue
- the new value to place in aModifiedValue
-
setParentId
Sets the ParentId of this Issue.- Parameters:
parentId
- The new parentId.- See Also:
-
setParentObject
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.- See Also:
-
setResolutionId
-
setArchived
void setArchived(boolean isArchived) -
setLabels
Set the labels for this issue.- Parameters:
labels
- the labels for this issue
-
getModifiedFields
Map<String,ModifiedValue> getModifiedFields()Retrieve a map of issue fields whose values have been set (since object creation or lastresetModifiedFields()
call.- Returns:
- A Map of key -> ModifiedValue pairs, where keys are defined in
IssueFieldConstants
and the value objects in the ModifiedValue are field-specific.
-
store
Deprecated.Use the Object's Service or Manager to save values. Since v5.0. DO NOT USE THIS as it overwrites all the fields of the issue which can result in difficult to reproduce bugs Prefer to use QueryDslAccessor to change only needed fieldsPersist this issue's immediate fields. This is for internal usage only.- Specified by:
store
in interfaceOfBizValueWrapper
-
setProjectObject(com.atlassian.jira.project.Project)
andsetNumber(Long)
to change issue.