@PublicApi public interface

MutableIssue

implements Issue
com.atlassian.jira.issue.MutableIssue
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

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

Summary

[Expand]
Inherited Fields
From interface com.atlassian.jira.entity.WithId
From interface com.atlassian.jira.issue.context.IssueContext
Public Methods
Map<StringModifiedValue> getModifiedFields()
Retrieve a map of issue fields whose values have been set (since object creation or last resetModifiedFields() call.
void resetModifiedFields()
Reset the internal list of modified fields.
void setAffectedVersions(Collection<Version> affectedVersions)
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 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 the getModifiedFields() and getExternalFieldValue(String).
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 the getModifiedFields() and 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 setKey(String key)
This method is deprecated. Use setProjectObject(com.atlassian.jira.project.Project) and setNumber(Long) to change issue. Since v6.1
void setLabels(Set<Label> labels)
Set the labels for this issue.
void setNumber(Long number)
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(GenericValue project)
This method is deprecated. Use setProjectObject(com.atlassian.jira.project.Project) instead. Since v5.0.
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(GenericValue securityLevel)
This method is deprecated. Use setSecurityLevelId(Long) instead. Since v5.0.
void setSecurityLevelId(Long securityLevelId)
Sets the SecurityLevel for this Issue.
void setStatus(Status 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 votes)
void setWorkflowId(Long workflowId)
@Internal void store()
This method is deprecated. Use the Object's Service or Manager to save values. Since v5.0.
[Expand]
Inherited Methods
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 Methods

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

Reset the internal list of modified fields.

public void setAffectedVersions (Collection<Version> affectedVersions)

Parameters
affectedVersions A collection of 'affects' Version objects.

public void setAssignee (ApplicationUser assignee)

public void setAssigneeId (String assigneeId)

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

Parameters
assigneeId The user key.

public void setComponent (Collection<ProjectComponent> 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 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 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 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 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 setFixVersions (Collection<Version> fixVersions)

Parameters
fixVersions A collection of fix-for Version objects.

public void setIssueType (IssueType issueType)

public void setIssueTypeId (String issueTypeId)

public void setIssueTypeObject (IssueType issueType)

Sets the IssueType for this Issue.

Parameters
issueType the new IssueType

public void setKey (String key)

This method is deprecated.
Use setProjectObject(com.atlassian.jira.project.Project) and setNumber(Long) to change issue. Since v6.1

public void setLabels (Set<Label> labels)

Set the labels for this issue.

Parameters
labels the labels for this issue

public void setNumber (Long number)

public void setOriginalEstimate (Long estimate)

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

Sets the priority for this Issue.

Parameters
priority the new priority value

public void setPriorityId (String priorityId)

Sets the priority for this Issue.

Parameters
priorityId the new priority value

public void setPriorityObject (Priority priority)

Sets the priority for this Issue.

Parameters
priority the new priority value

public void setProject (GenericValue project)

This method is deprecated.
Use setProjectObject(com.atlassian.jira.project.Project) instead. Since v5.0.

Sets the Project for this Issue.

Parameters
project the new Project

public void setProjectId (Long projectId)

Sets the project by id.

Parameters
projectId The id of the project
Throws
IllegalArgumentException If no project exists for the given projectId.

public void setProjectObject (Project project)

Sets the Project for this Issue.

Parameters
project the new Project

public void setReporter (ApplicationUser 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 (Resolution resolution)

Sets the resolution for this Issue.

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)

This method is deprecated.
Use setSecurityLevelId(Long) instead. Since v5.0.

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

public void setWorkflowId (Long workflowId)

@Internal public void store ()

@Internal

This method is an internal implementation detail and will change without notice.

Clients that depend on @Internal classes and interfaces can not expect to be compatible with any version other than the version they were compiled against (even minor version and milestone releases may break binary compatibility with respect to @Internal elements).

This method is deprecated.
Use the Object's Service or Manager to save values. Since v5.0.

Persist this issue's immediate fields. This is for internal usage only.