public class

BulkMoveOperationImpl

extends Object
implements BulkMoveOperation
java.lang.Object
   ↳ com.atlassian.jira.bulkedit.operation.BulkMoveOperationImpl

Class Overview

Operation for moving parent and their sub-takks issues from one or many contexts to a single target context.

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.bulkedit.operation.BulkMoveOperation
Fields
protected static final Logger log
Public Constructors
BulkMoveOperationImpl(WorkflowManager workflowManager, ProjectManager projectManager, FieldManager fieldManager, IssueFactory issueFactory, IssueManager issueManager, IssueEventManager issueEventManager, BulkEditBeanSessionHelper bulkEditBeanSessionHelper, AttachmentManager attachmentManager, IssueEventBundleFactory issueEventBundleFactory, IssueLinkManager issueLinkManager, SubTaskManager subTaskManager, IssueToSubTaskConversionService issueToSubTaskConversionService)
Public Methods
boolean canPerform(BulkEditBean bulkEditBean, ApplicationUser applicationUser)
Determines whether the operation can be performed with the given set of issues
void chooseContext(BulkEditBean bulkEditBean, ApplicationUser applicationUser, I18nHelper i18nHelper, ErrorCollection errors)
void chooseContextNoValidate(BulkEditBean bulkEditBean, ApplicationUser applicationUser)
@Deprecated void finishChooseContext(MultiBulkMoveBean multiBulkMoveBean, ApplicationUser applicationUser)
Does the finishChooseContext() operation for all the BulkEditBeans in the given MultiBulkMoveBean.
void finishChooseContext(BulkEditBean bulkEditBean, ApplicationUser applicationUser)
Does operations on the given BulkEditBean to finalise the "Choose Project and Issue Type" step of the Bulk Move.
String getCannotPerformMessageKey()
An i18n key to be used to render the error message to be displayed when the user can not perform this bulk operation.
String getDescriptionKey()
String getFieldName(Field field, I18nHelper i18nHelper)
String getNameKey()
An i18n key used to display a short description of this operation in the UI.
int getNumberOfTasks(BulkEditBean bulkEditBean)
Returns number of tasks/stages to be executed as part of this bulk operation.
String getOperationName()
Returns the "operation name".
JiraWorkflow getWorkflowForType(Long projectId, String issueTypeId)
boolean isStatusValid(BulkEditBean bulkEditBean)
void moveIssuesAndIndex(BulkEditBean bulkEditBean, ApplicationUser remoteUser)
void moveIssuesAndIndex(BulkEditBean bulkEditBean, ApplicationUser applicationUser, Context taskContext)
void perform(BulkEditBean bulkEditBean, ApplicationUser applicationUser, Context taskContext)
Performs the operation on the given set of issues
void setStatusFields(BulkEditBean bulkEditBean)
void validatePopulateFields(BulkEditBean bulkEditBean, ErrorCollection errors, I18nHelper i18nHelper)
Protected Methods
Object getParam(String id, Map<StringString[]> params)
Collection<Field> getTargetHiddenFields(BulkEditBean bulkEditBean)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.bulkedit.operation.BulkMoveOperation
From interface com.atlassian.jira.bulkedit.operation.ProgressAwareBulkOperation
From interface com.atlassian.jira.issue.operation.IssueOperation

Fields

protected static final Logger log

Public Constructors

public BulkMoveOperationImpl (WorkflowManager workflowManager, ProjectManager projectManager, FieldManager fieldManager, IssueFactory issueFactory, IssueManager issueManager, IssueEventManager issueEventManager, BulkEditBeanSessionHelper bulkEditBeanSessionHelper, AttachmentManager attachmentManager, IssueEventBundleFactory issueEventBundleFactory, IssueLinkManager issueLinkManager, SubTaskManager subTaskManager, IssueToSubTaskConversionService issueToSubTaskConversionService)

Public Methods

public boolean canPerform (BulkEditBean bulkEditBean, ApplicationUser applicationUser)

Determines whether the operation can be performed with the given set of issues

public void chooseContext (BulkEditBean bulkEditBean, ApplicationUser applicationUser, I18nHelper i18nHelper, ErrorCollection errors)

public void chooseContextNoValidate (BulkEditBean bulkEditBean, ApplicationUser applicationUser)

@Deprecated public void finishChooseContext (MultiBulkMoveBean multiBulkMoveBean, ApplicationUser applicationUser)

Does the finishChooseContext() operation for all the BulkEditBeans in the given MultiBulkMoveBean.

Parameters
multiBulkMoveBean MultiBulkMoveBean (Contains Collection of BulkEditBean objects).
applicationUser User

public void finishChooseContext (BulkEditBean bulkEditBean, ApplicationUser applicationUser)

Does operations on the given BulkEditBean to finalise the "Choose Project and Issue Type" step of the Bulk Move.

This method should be called AFTER validation of the new context, and re-mapping the BulkEditBeans to be indexed by Target context.

  • Sets the target field layout (aka "Field Configuration") according to target Project and Issue Type.
  • Decides which Issue Fields need to be edited by the user.
  • Will delete values for fields that should be removed (ie not used in new context).
  • Sets the SubTaskBulkEditBean if any of these issues have subtasks which will also need to be moved.

Parameters
bulkEditBean BulkEditBean containing Bulk Move information for a single target "Issue Context".
applicationUser User doing the operation.

public String getCannotPerformMessageKey ()

An i18n key to be used to render the error message to be displayed when the user can not perform this bulk operation.

Returns
  • An i18n key to be used to render the error message to be displayed when the user can not perform this bulk operation.

public String getDescriptionKey ()

public String getFieldName (Field field, I18nHelper i18nHelper)

public String getNameKey ()

An i18n key used to display a short description of this operation in the UI. e.g " Watch Issues "

Returns
  • An i18n key used to display a short description of this operation in the UI

public int getNumberOfTasks (BulkEditBean bulkEditBean)

Returns number of tasks/stages to be executed as part of this bulk operation. The number returned here must be consistent with the number of updates performed as part of perform(com.atlassian.jira.web.bean.BulkEditBean, com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.task.context.Context).

Returns
  • Number of tasks/stages to be executed

public String getOperationName ()

Returns the "operation name".

This is used to build up the name of the action used to render the details screen in the bulk change UI.

The action name that is generated as operationName + "Details.jspa". See BulkChooseOperation for details

Returns
  • The "operation name"

public JiraWorkflow getWorkflowForType (Long projectId, String issueTypeId)

public boolean isStatusValid (BulkEditBean bulkEditBean)

public void moveIssuesAndIndex (BulkEditBean bulkEditBean, ApplicationUser remoteUser)

public void moveIssuesAndIndex (BulkEditBean bulkEditBean, ApplicationUser applicationUser, Context taskContext)

public void perform (BulkEditBean bulkEditBean, ApplicationUser applicationUser, Context taskContext)

Performs the operation on the given set of issues

public void setStatusFields (BulkEditBean bulkEditBean)

public void validatePopulateFields (BulkEditBean bulkEditBean, ErrorCollection errors, I18nHelper i18nHelper)

Protected Methods

protected Object getParam (String id, Map<StringString[]> params)

protected Collection<Field> getTargetHiddenFields (BulkEditBean bulkEditBean)