Interface MutableIssue

All Superinterfaces:
Issue, IssueContext, OfBizValueWrapper, Serializable, WithId, WithKey
All Known Implementing Classes:
GenericMutableIssueWrapper, IssueImpl, MockIssue

@PublicApi public interface MutableIssue extends Issue
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:
  • Method Details

    • setProject

      void setProject(org.ofbiz.core.entity.GenericValue project)
      Deprecated.
      Sets the Project for this Issue.
      Parameters:
      project - the new Project
    • setProjectObject

      void setProjectObject(Project project)
      Sets the Project for this Issue.
      Parameters:
      project - the new Project
    • setProjectId

      void setProjectId(Long projectId) throws IllegalArgumentException
      Sets the project by id.
      Parameters:
      projectId - The id of the project
      Throws:
      IllegalArgumentException - If no project exists for the given projectId.
    • setIssueType

      void setIssueType(IssueType issueType)
    • setIssueTypeObject

      void setIssueTypeObject(IssueType issueType)
      Sets the IssueType for this Issue.
      Parameters:
      issueType - the new IssueType
    • setIssueTypeId

      void setIssueTypeId(String issueTypeId)
    • setSummary

      void setSummary(String summary)
    • setAssignee

      void setAssignee(ApplicationUser assignee)
    • setComponent

      void setComponent(Collection<ProjectComponent> components)
      Sets the components for this Issue.
      Parameters:
      components - the new components value
      Since:
      v5.0
    • setAssigneeId

      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.
    • setReporter

      void setReporter(ApplicationUser reporter)
    • setReporterId

      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.
      See Also:
    • setDescription

      void setDescription(String description)
    • setEnvironment

      void setEnvironment(String environment)
    • setAffectedVersions

      void setAffectedVersions(Collection<Version> affectedVersions)
      Parameters:
      affectedVersions - A collection of 'affects' Version objects.
    • setFixVersions

      void setFixVersions(Collection<Version> fixVersions)
      Parameters:
      fixVersions - A collection of fix-for Version objects.
    • setDueDate

      void setDueDate(Timestamp dueDate)
    • setSecurityLevelId

      void setSecurityLevelId(Long securityLevelId)
      Sets the SecurityLevel for this Issue.
      Parameters:
      securityLevelId - the new SecurityLevel value
    • setSecurityLevel

      void setSecurityLevel(org.ofbiz.core.entity.GenericValue securityLevel)
      Deprecated.
      Use setSecurityLevelId(Long) instead. Since v5.0.
      Sets the SecurityLevel for this Issue.
      Parameters:
      securityLevel - the new SecurityLevel value
    • setPriority

      void setPriority(@Nullable Priority priority)
      Sets the priority for this Issue.
      Parameters:
      priority - the new priority value
    • setPriorityObject

      void setPriorityObject(@Nullable Priority priority)
      Sets the priority for this Issue.
      Parameters:
      priority - the new priority value
    • setPriorityId

      void setPriorityId(String priorityId)
      Sets the priority for this Issue.
      Parameters:
      priorityId - the new priority value
    • setResolution

      void setResolution(Resolution resolution)
      Sets the resolution for this Issue.
    • setResolutionObject

      void setResolutionObject(Resolution resolution)
      Sets the resolution for this Issue.
      Parameters:
      resolution - the new resolution value
    • setKey

      void setKey(String key)
      Deprecated.
      Parameters:
      key -
    • setNumber

      void setNumber(Long number)
    • setVotes

      void setVotes(Long votes)
    • setWatches

      void setWatches(Long votes)
    • setCreated

      void setCreated(Timestamp created)
    • setUpdated

      void setUpdated(Timestamp updated)
    • setResolutionDate

      void setResolutionDate(Timestamp resolutionDate)
    • setWorkflowId

      void setWorkflowId(Long workflowId)
    • setCustomFieldValue

      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 OrderableField.updateIssue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, MutableIssue, java.util.Map)
      Parameters:
      customField - the CustomField
      value - the value.
    • setStatus

      void setStatus(Status status)
      Sets the status for this Issue.
      Parameters:
      status - the new status value
    • setStatusObject

      void setStatusObject(Status status)
      Sets the status for this Issue.
      Parameters:
      status - the new status value
    • setStatusId

      void setStatusId(String statusId)
      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

      void setOriginalEstimate(Long estimate)
    • setTimeSpent

      void setTimeSpent(Long timespent)
    • setEstimate

      void setEstimate(Long estimate)
    • setExternalFieldValue

      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 Issue.getExternalFieldValue(String).

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

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

      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 Issue.getExternalFieldValue(String).

      The passed in newValue will be wrapped in the ModifiedValue.getNewValue() and the oldValue will be placed in ModifiedValue.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
    • setParentId

      void setParentId(Long parentId)
      Sets the ParentId of this Issue.
      Parameters:
      parentId - The new parentId.
      See Also:
    • setParentObject

      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.
      See Also:
    • setResolutionId

      void setResolutionId(String resolutionId)
    • setArchived

      void setArchived(boolean isArchived)
    • setLabels

      void setLabels(Set<Label> labels)
      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 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.
    • store

      @Internal @Deprecated void 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 fields
      Persist this issue's immediate fields. This is for internal usage only.
      Specified by:
      store in interface OfBizValueWrapper