Class MoveIssue

All Implemented Interfaces:
OperationContext, ErrorCollection, I18nHelper, Assignable, IssueSummaryAware, HttpServletVariables, AuthorizationSupport, Serializable, webwork.action.Action, webwork.action.CommandDriven, webwork.action.IllegalArgumentAware
Direct Known Subclasses:
MoveIssueSubtasks, MoveIssueUpdateFields, MoveIssueUpdateWorkflow, MoveSubTask, MoveSubTaskChooseOperation, MoveSubTaskParent

public class MoveIssue extends AbstractCommentableAssignableIssue
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • doExecute

      protected String doExecute() throws Exception
      Handles the request to submit the input from the first step of the wizard, the submitted information is the target project and the target issue type.

      If the issue has sub-tasks it redirects to MoveIssueSubtasks.doDefault() so that the tasks issue types can be mapped; otherwise, it redirects to MoveIssueUpdateWorkflow.doDefault()
      Overrides:
      doExecute in class webwork.action.ActionSupport
      Returns:
      It actually doesn't return anything. If the issue has sub-tasks it redirects to MoveIssueSubtasks.doDefault() so that the tasks issue types can be mapped; otherwise, it redirects to MoveIssueUpdateWorkflow.doDefault()
      Throws:
      Exception
    • doDefault

      public String doDefault() throws Exception
      Handles the initial request to move an issue. It returns the view responsible for rendering the first step of the wizard, if the user is authorised to perform the move and if the issue exists.
      Overrides:
      doDefault in class AbstractCommentableAssignableIssue
      Returns:
      "securitybreach" if the user is not authorised to move the issue; Action.ERROR if the issue can't be found (which means it was probably deleted), or if the user isn't authorised to browse the issue; otherwise, Action.INPUT} is returned to render the view for the first step of the wizard.
      Throws:
      Exception
    • doValidation

      protected void doValidation()
      Overrides:
      doValidation in class AbstractCommentableAssignableIssue
    • redirectToSessionTimeoutPage

      protected String redirectToSessionTimeoutPage()
    • validateAttachmentMove

      protected void validateAttachmentMove()
    • validateCreateIssue

      protected void validateCreateIssue() throws org.ofbiz.core.entity.GenericEntityException
      Throws:
      org.ofbiz.core.entity.GenericEntityException
    • getTargetPid

      public Long getTargetPid()
    • getTargetStatusId

      public String getTargetStatusId()
    • getTargetProjectObj

      public Project getTargetProjectObj()
    • getTargetIssueTypeObject

      public IssueType getTargetIssueTypeObject()
    • getTargetWorkflow

      public JiraWorkflow getTargetWorkflow() throws WorkflowException
      Throws:
      WorkflowException
    • getCurrentWorkflow

      public JiraWorkflow getCurrentWorkflow() throws WorkflowException, org.ofbiz.core.entity.GenericEntityException
      Throws:
      WorkflowException
      org.ofbiz.core.entity.GenericEntityException
    • getWorkflowForType

      public JiraWorkflow getWorkflowForType(Long projectId, String issueTypeId) throws WorkflowException
      Throws:
      WorkflowException
    • getCurrentStatus

      public Status getCurrentStatus()
    • getCurrentStatusObject

      public Status getCurrentStatusObject()
    • getTargetIssueType

      public String getTargetIssueType()
    • getCurrentIssueType

      public String getCurrentIssueType()
    • getAllowedProjects

      public Collection getAllowedProjects()
    • isSubTask

      public boolean isSubTask()
      Description copied from class: AbstractIssueSelectAction
      Determines whether the issue is a sub task - i.e. if it has any incoming sub-task issue links
      Overrides:
      isSubTask in class AbstractIssueSelectAction
      Returns:
      whether the issue is a sub task.
    • getTargetWorkflowStatuses

      public Collection<Status> getTargetWorkflowStatuses(String issueTypeId)
      Retrieve a collection of target workflow statuses from the workflow associated with the specified issue type id.
      Parameters:
      issueTypeId - the id of the specified issue type.
      Returns:
      A collection of target workflow statuses from the workflow associated with the specified issue type id.
    • isWorkflowMatch

      public boolean isWorkflowMatch(String currentIssueTypeId, String targetIssueTypeId)
      Check if the workflow is the same for the current and target issue types
      Parameters:
      currentIssueTypeId - the id of the issue's current issue type.
      targetIssueTypeId - the id of the target issue type.
      Returns:
      true if the workflows associated to the current and target issue types are the same; otherwise, false.
    • isHasSubTasks

      public boolean isHasSubTasks()
      Checks if the current issue has sub-tasks.
      Returns:
      true if sub-tasks have been enabled and the current issue has sub-tasks; otherwise, false.
    • getSubTasks

      public Collection<org.ofbiz.core.entity.GenericValue> getSubTasks()
      Retrieves the collection of sub-tasks associated with the current issue.
      Returns:
      The collection of sub-tasks associated with the current issue.
    • getSubTaskTypesUsed

      public Collection<org.ofbiz.core.entity.GenericValue> getSubTaskTypesUsed()
      Gets the collection of sub-task types used in the sub-tasks associated with the current issue.
      Returns:
      The collection of sub-task types used in the sub-tasks associated with the current issue.
    • getPrefixTaskStatusId

      public String getPrefixTaskStatusId(String taskTypeId, String taskStatusId)
    • getPrefixIssueTypeId

      public String getPrefixIssueTypeId(String issueType)
    • getSubTaskTargetStatus

      public String getSubTaskTargetStatus(String taskTypeId, String taskStatusId)
      Retrieve the task status associated with this type and current status.
      Parameters:
      taskTypeId - the id of the task type.
      taskStatusId - the id of the task status.
      Returns:
      The task status associated with this type and current status.
    • isStatusChangeRequired

      public boolean isStatusChangeRequired()
      Checks if the current statuses of the issue and its sub-tasks do not exist in the target workflow.

      This is used to determine if step 2 requires input from the user, i.e. If all current statuses exist in the target workflows - no input is needed.

      Returns:
      true if the current statuses of the issue and its sub-tasks do not exist in the target workflow; otherwise, false.
    • isTaskStatusChangeRequired

      public boolean isTaskStatusChangeRequired() throws WorkflowException
      Throws:
      WorkflowException
    • isIssueStatusValid

      public boolean isIssueStatusValid() throws WorkflowException
      Throws:
      WorkflowException
    • isTaskStatusValid

      public boolean isTaskStatusValid(String typeId, String statusId) throws WorkflowException
      Throws:
      WorkflowException
    • getTaskInvalidStatuses

      public Collection<Status> getTaskInvalidStatuses(String typeId) throws WorkflowException
      Throws:
      WorkflowException
    • getTaskInvalidStatusObjects

      public Collection getTaskInvalidStatusObjects(String typeId) throws WorkflowException
      Throws:
      WorkflowException
    • getTasksWithStatus

      public Collection getTasksWithStatus(String invalidStatusId) throws WorkflowException
      Throws:
      WorkflowException
    • getFieldLayoutManager

      protected FieldLayoutManager getFieldLayoutManager()
    • getConstantsManager

      public ConstantsManager getConstantsManager()
      Overrides:
      getConstantsManager in class JiraWebActionSupport
    • getWorkflowManager

      protected WorkflowManager getWorkflowManager()
    • getMoveIssueBean

      public MoveIssueBean getMoveIssueBean()
    • setBeanTargetStatusId

      public void setBeanTargetStatusId(String targetStatusId)
    • getBeanTargetStatusId

      public String getBeanTargetStatusId()
    • getFieldHtml

      public String getFieldHtml(String fieldId) throws Exception
      Throws:
      Exception
    • getViewHtmlParams

      protected Map getViewHtmlParams()
    • getIssueObject

      public MutableIssue getIssueObject(org.ofbiz.core.entity.GenericValue issue)
    • getFieldManager

      protected FieldManager getFieldManager()
    • getSubtaskTargetIssueType

      public String getSubtaskTargetIssueType(String subtaskIssueType)
      Get the target issue type for a migrating issue type.

      NOTE: This is currently used solely in moveissue-updateworkflow.jsp to construct a dropdown of statuses for the subtask target issue type.

      Parameters:
      subtaskIssueType - the current issue type id
      Returns:
      the target issue type id