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.MessageType
Nested classes/interfaces inherited from interface com.atlassian.jira.util.ErrorCollection
ErrorCollection.Reason
Nested classes/interfaces inherited from interface com.atlassian.jira.util.I18nHelper
I18nHelper.BeanFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConstantsManager
protected final FieldLayoutManager
protected final FieldManager
protected final IssueFactory
static final String
protected final WorkflowManager
Fields inherited from class com.atlassian.jira.web.action.issue.AbstractCommentableIssue
userUtil
Fields inherited from class com.atlassian.jira.web.action.issue.AbstractIssueSelectAction
id, ISSUE_PERMISSION_ERROR, PREPOPULATED_ISSUE_OBJECT
Fields inherited from class com.atlassian.jira.web.action.IssueActionSupport
attachmentManager
Fields inherited from class com.atlassian.jira.web.action.ProjectActionSupport
projectManager
Fields inherited from class com.atlassian.jira.web.action.JiraWebActionSupport
ISSUE_NOT_FOUND_RESULT, log, PERMISSION_VIOLATION_RESULT, request, RETURN_URL_PARAMETER, savedFilters, SECURITY_BREACH_RESULT
Fields inherited from class webwork.action.ActionSupport
command, errorMap, errorMessages
Fields 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 String
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.protected void
getFieldHtml
(String fieldId) protected FieldLayoutManager
protected FieldManager
getIssueObject
(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 Map
getWorkflowForType
(Long projectId, String issueTypeId) protected WorkflowManager
boolean
Checks if the current issue has sub-tasks.boolean
boolean
Checks if the current statuses of the issue and its sub-tasks do not exist in the target workflow.boolean
Determines whether the issue is a sub task - i.e.boolean
boolean
isTaskStatusValid
(String typeId, String statusId) boolean
isWorkflowMatch
(String currentIssueTypeId, String targetIssueTypeId) Check if the workflow is the same for the current and target issue typesprotected String
void
setBeanTargetStatusId
(String targetStatusId) protected void
protected void
Methods inherited from class com.atlassian.jira.web.action.issue.AbstractCommentableAssignableIssue
assigneeChanged, getAssignee, getAssignIn, hasAssigneePermission, setAssignee
Methods 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, setGroupLevel
Methods inherited from class com.atlassian.jira.web.action.issue.AbstractViewIssue
getAttachments, getPossibleComponents, getPossibleVersions, getPossibleVersionsReleasedFirst
Methods 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, setViewIssueKey
Methods 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, updateSearchRequest
Methods inherited from class com.atlassian.jira.web.action.ProjectActionSupport
getBrowsableProjects, getSelectedProjectId, setSelectedProject, setSelectedProject
Methods 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, 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, urlEncode
Methods inherited from class webwork.action.ActionSupport
addError, getCommandName, getHasErrorMessages, getHasErrors, getPropertyEditorMessage, getTexts, getTexts, getTimezone, invalidInput, invokeCommand, isCommand, setCommand, setErrorMessages, setErrors, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface webwork.action.CommandDriven
getCommandName, setCommand
Methods inherited from interface com.atlassian.jira.util.ErrorCollection
addError, setErrorMessages
Methods 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:
doExecute
in 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:
doDefault
in classAbstractCommentableAssignableIssue
- 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 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:
WorkflowException
org.ofbiz.core.entity.GenericEntityException
-
getWorkflowForType
- Throws:
WorkflowException
-
getCurrentStatus
-
getCurrentStatusObject
-
getTargetIssueType
-
getCurrentIssueType
-
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 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:
getConstantsManager
in 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
-