Class MoveIssue
java.lang.Object
- 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
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
JiraWebActionSupport.MessageTypeNested classes/interfaces inherited from interface com.atlassian.jira.util.ErrorCollection
ErrorCollection.ReasonNested classes/interfaces inherited from interface com.atlassian.jira.util.I18nHelper
I18nHelper.BeanFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConstantsManagerprotected final FieldLayoutManagerprotected final FieldManagerprotected final IssueFactorystatic final Stringprotected final WorkflowManagerFields inherited from class com.atlassian.jira.web.action.issue.AbstractCommentableIssue
userUtilFields inherited from class com.atlassian.jira.web.action.issue.AbstractIssueSelectAction
id, ISSUE_PERMISSION_ERROR, PREPOPULATED_ISSUE_OBJECTFields inherited from class com.atlassian.jira.web.action.IssueActionSupport
attachmentManagerFields inherited from class com.atlassian.jira.web.action.ProjectActionSupport
projectManagerFields inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
ISSUE_NOT_FOUND_RESULT, log, PERMISSION_VIOLATION_RESULT, request, RETURN_URL_PARAMETER, savedFilters, SECURITY_BREACH_RESULTFields inherited from class webwork.action.ActionSupport
command, errorMap, errorMessagesFields inherited from interface webwork.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS -
Constructor Summary
ConstructorsConstructorDescriptionMoveIssue(SubTaskManager subTaskManager, ConstantsManager constantsManager, WorkflowManager workflowManager, FieldManager fieldManager, FieldLayoutManager fieldLayoutManager, IssueFactory issueFactory, FieldScreenRendererFactory fieldScreenRendererFactory, CommentService commentService, UserUtil userUtil, UserManager userManager) -
Method Summary
Modifier and TypeMethodDescriptionHandles the initial request to move an issue.protected StringHandles 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.protected voidgetFieldHtml(String fieldId) protected FieldLayoutManagerprotected FieldManagergetIssueObject(org.ofbiz.core.entity.GenericValue issue) getPrefixIssueTypeId(String issueType) getPrefixTaskStatusId(String taskTypeId, String taskStatusId) Collection<org.ofbiz.core.entity.GenericValue> Retrieves the collection of sub-tasks associated with the current issue.getSubtaskTargetIssueType(String subtaskIssueType) Get the target issue type for a migrating issue type.getSubTaskTargetStatus(String taskTypeId, String taskStatusId) Retrieve the task status associated with this type and current status.Collection<org.ofbiz.core.entity.GenericValue> Gets the collection of sub-task types used in the sub-tasks associated with the current issue.getTargetWorkflowStatuses(String issueTypeId) Retrieve a collection of target workflow statuses from the workflow associated with the specified issue type id.getTaskInvalidStatuses(String typeId) getTaskInvalidStatusObjects(String typeId) getTasksWithStatus(String invalidStatusId) protected MapgetWorkflowForType(Long projectId, String issueTypeId) protected WorkflowManagerbooleanChecks if the current issue has sub-tasks.booleanbooleanChecks if the current statuses of the issue and its sub-tasks do not exist in the target workflow.booleanDetermines whether the issue is a sub task - i.e.booleanbooleanisTaskStatusValid(String typeId, String statusId) booleanisWorkflowMatch(String currentIssueTypeId, String targetIssueTypeId) Check if the workflow is the same for the current and target issue typesprotected StringvoidsetBeanTargetStatusId(String targetStatusId) protected voidprotected voidMethods inherited from class com.atlassian.jira.web.action.issue.AbstractCommentableAssignableIssue
assigneeChanged, getAssignee, getAssignIn, hasAssigneePermission, setAssigneeMethods inherited from class com.atlassian.jira.web.action.issue.AbstractCommentableIssue
createComment, doCommentValidation, getComment, getCommentLevel, getDisplayParams, getFieldScreenRendererLayoutItemForField, getFieldScreenRendererWithAllFields, getFieldValuesHolder, getGroupLevel, getGroupLevels, getIssueOperation, getOrderableField, getRoleLevels, populateAttachmentsFieldValuesHolderAndValidate, populateCommentFields, processAttachments, processAttachments, requireAttachmentsResources, setComment, setCommentLevel, setFieldValuesHolder, setGroupLevelMethods inherited from class com.atlassian.jira.web.action.issue.AbstractViewIssue
getAttachments, getPossibleComponents, getPossibleVersions, getPossibleVersionsReleasedFirstMethods inherited from class com.atlassian.jira.web.action.issue.AbstractIssueSelectAction
addErrorMessage, assertIssueIsValid, cameFromIssue, cameFromParent, getId, getIssue, getIssueObject, getIssueObjectWithoutDatabaseRead, getIssuePath, getKey, getLayoutBean, getMutableIssue, getParentIssueObject, getProject, getProjectObject, getSecurityLevel, getSubTaskManager, getSummaryIssue, getViewIssueKey, getViewUrl, isEditable, isEditable, isHasEditIssuePermission, isIssueExists, isIssueValid, isSubTaskCreatable, isWorkflowAllowsEdit, redirectToView, refreshIssueObject, setId, setIssueObject, setKey, setViewIssueKeyMethods inherited from class com.atlassian.jira.web.action.IssueActionSupport
addIssueToHistory, getAttachmentManager, getCurrentDateTimeInUsersTimezone, getCurrentFailedLoginCount, getCurrentJQL, getCustomFieldManager, getDaysPerWeek, getEverLoggedIn, getFormToken, getHoursPerDay, getIssueManager, getLastFailedLogin, getLastLogin, getLoginCount, getPossibleVersions, getPossibleVersionsReleasedFirst, getPrettyDuration, getPreviousLogin, getSearchRequest, getSelectedIssueId, getSessionPagerFilterManager, getSessionSearchRequestManager, getSessionSearchRequestManagerFactory, getSessionSelectedIssueManager, getTotalFailedLoginCount, getUrlEncoded, getWorkflow, getWorkflowTransitionDescription, getWorkflowTransitionDisplayName, isCustomFieldHidden, isElevatedSecurityCheckRequired, isFieldHidden, isFieldHidden, isTimeTrackingEnabled, setFormToken, setSearchRequest, setSelectedIssueId, updateSearchRequestMethods inherited from class com.atlassian.jira.web.action.ProjectActionSupport
getBrowsableProjects, getSelectedProjectId, setSelectedProject, setSelectedProjectMethods inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
addError, addErrorCollection, addErrorMessage, addErrorMessageByKeyIfAbsent, addErrorMessageIfAbsent, addErrorMessages, addErrorMessages, addErrors, addIllegalArgumentException, addMessageToResponse, addReason, addReasons, checkIfUrlIsAllowed, execute, forceRedirect, getActionName, getActionNameJspa, getAdministratorContactLink, getApplicationProperties, getAuthorizationSupport, getComponentInstanceOfType, getConglomerateCookieValue, getDateFormat, getDateTimeFormat, getDateTimeFormatter, getDefaultResourceBundle, getDescTranslation, getDescTranslation, getDmyDateFormatter, getEmptyResponse, getErrorMessages, getErrors, getField, getFlushedErrorMessages, getGlobalPermissionManager, getHint, getHintManager, getHttpRequest, getHttpResponse, getHttpSession, getI18nHelper, getJiraContactHelper, getJiraServiceContext, getKeysForPrefix, getLanguage, getLocale, getLoggedInApplicationUser, getLoggedInUser, getNameTranslation, getNameTranslation, getOfBizDelegator, getOutboundWhitelistProvider, getOutlookDate, getPermissionManager, getProjectManager, getRandomHint, getReasons, getRedirect, getRedirect, getRedirectSanitiser, getRequestSourceType, getResourceBundle, getResult, getReturnUrl, getReturnUrlForCancelLink, getSearchSortDescriptions, getSelectedProject, getSelectedProjectObject, getServerId, getServletContext, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTimeFormat, getUnescapedText, getUntransformedRawText, getUriValidator, getUserFullName, getUserManager, getUserPreferences, getUserProjectHistoryManager, getVersionManager, getWebworkStack, getWebworkStack, getXsrfToken, hasAnyErrors, hasErrorMessage, hasErrorMessageByKey, hasGlobalPermission, hasGlobalPermission, hasIssuePermission, hasIssuePermission, hasIssuePermission, hasPermission, hasProjectPermission, hasProjectPermission, htmlEncode, insertContextPath, isAdministrator, isIndexing, isInlineDialogMode, isKeyDefined, isSystemAdministrator, isUserExists, isUserExistsByKey, isUserExistsByName, removeKeyOrAddError, returnComplete, returnComplete, returnCompleteWithInlineRedirect, returnCompleteWithInlineRedirectAndMsg, returnCompleteWithInlineRedirectAndMsg, returnMsgToUser, returnMsgToUser, setConglomerateCookieValue, setInline, setReasons, setReturnUrl, setSelectedProjectId, tagMauEventWithApplication, tagMauEventWithProject, urlEncodeMethods inherited from class webwork.action.ActionSupport
addError, getCommandName, getHasErrorMessages, getHasErrors, getPropertyEditorMessage, getTexts, getTexts, getTimezone, invalidInput, invokeCommand, isCommand, setCommand, setErrorMessages, setErrors, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface webwork.action.CommandDriven
getCommandName, setCommandMethods inherited from interface com.atlassian.jira.util.ErrorCollection
addError, setErrorMessagesMethods inherited from interface com.atlassian.jira.web.action.issue.IssueSummaryAware
getLoggedInApplicationUser
-
Field Details
-
SUBTASK_STATUS_PREFIX
- See Also:
-
constantsManager
-
workflowManager
-
fieldManager
-
fieldLayoutManager
-
issueFactory
-
-
Constructor Details
-
MoveIssue
public MoveIssue(SubTaskManager subTaskManager, ConstantsManager constantsManager, WorkflowManager workflowManager, FieldManager fieldManager, FieldLayoutManager fieldLayoutManager, IssueFactory issueFactory, FieldScreenRendererFactory fieldScreenRendererFactory, CommentService commentService, UserUtil userUtil, UserManager userManager)
-
-
Method Details
-
doExecute
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 toMoveIssueSubtasks.doDefault()so that the tasks issue types can be mapped; otherwise, it redirects toMoveIssueUpdateWorkflow.doDefault()- Overrides:
doExecutein classwebwork.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 toMoveIssueUpdateWorkflow.doDefault() - Throws:
Exception
-
doDefault
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:
doDefaultin classAbstractCommentableAssignableIssue- Returns:
- "securitybreach" if the user is not authorised to move the issue;
Action.ERRORif 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:
doValidationin classAbstractCommentableAssignableIssue
-
redirectToSessionTimeoutPage
-
validateAttachmentMove
protected void validateAttachmentMove() -
validateCreateIssue
protected void validateCreateIssue() throws org.ofbiz.core.entity.GenericEntityException- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getTargetPid
-
getTargetStatusId
-
getTargetProjectObj
-
getTargetIssueTypeObject
-
getTargetWorkflow
- Throws:
WorkflowException
-
getCurrentWorkflow
public JiraWorkflow getCurrentWorkflow() throws WorkflowException, org.ofbiz.core.entity.GenericEntityException- Throws:
WorkflowExceptionorg.ofbiz.core.entity.GenericEntityException
-
getWorkflowForType
- Throws:
WorkflowException
-
getCurrentStatus
-
getCurrentStatusObject
-
getTargetIssueType
-
getCurrentIssueType
-
getAllowedProjects
-
isSubTask
public boolean isSubTask()Description copied from class:AbstractIssueSelectActionDetermines whether the issue is a sub task - i.e. if it has any incoming sub-task issue links- Overrides:
isSubTaskin classAbstractIssueSelectAction- Returns:
- whether the issue is a sub task.
-
getTargetWorkflowStatuses
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
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
Retrieves the collection of sub-tasks associated with the current issue.- Returns:
- The collection of sub-tasks associated with the current issue.
-
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
-
getPrefixIssueTypeId
-
getSubTaskTargetStatus
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
- Throws:
WorkflowException
-
isIssueStatusValid
- Throws:
WorkflowException
-
isTaskStatusValid
- Throws:
WorkflowException
-
getTaskInvalidStatuses
- Throws:
WorkflowException
-
getTaskInvalidStatusObjects
- Throws:
WorkflowException
-
getTasksWithStatus
- Throws:
WorkflowException
-
getFieldLayoutManager
-
getConstantsManager
- Overrides:
getConstantsManagerin classJiraWebActionSupport
-
getWorkflowManager
-
getMoveIssueBean
-
setBeanTargetStatusId
-
getBeanTargetStatusId
-
getFieldHtml
- Throws:
Exception
-
getViewHtmlParams
-
getIssueObject
-
getFieldManager
-
getSubtaskTargetIssueType
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
-