com.atlassian.jira.workflow.WorkflowManager |
Known Indirect Subclasses |
Clients of @PublicApi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicApi
as per each product's API policy as long as the client does not implement/extend
@PublicApi
interfaces or classes (refer to each product's API policy for the exact
guarantee---usually binary compatibility is guaranteed at least across minor versions).
@PublicApi
interfaces and classes are not designed to be implemented or extended by clients,
we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not
affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces
annotated with @PublicSpi
are safe to extend/implement).
The WorkflowManager is used to interface with the workflow implementation
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
Since 5.1. This method should not be used directly by external developers as it is an operation
that only makes sense in the context of a higher level operation in JIRA (i.e. project removal / changing the
workflow scheme of a given project).
Please use the API calls for these higher level operations instead. | |||||||||||
Provided a set of workflows, this method will check, if the passed in inactive workflows have any drafts linked
to them.
| |||||||||||
Clones a workflow by creating a deep copy of the workflow provided.
| |||||||||||
This method is deprecated.
Use
copyWorkflow(com.atlassian.jira.user.ApplicationUser, String, String, JiraWorkflow) instead. Since v6.0.
| |||||||||||
This method is deprecated.
Use
createDraftWorkflow(com.atlassian.jira.user.ApplicationUser, String) instead. Since v6.0.
| |||||||||||
This will create an draft workflow of the named active workflow.
| |||||||||||
Create an issue in the database.
| |||||||||||
This method is deprecated.
Use
createWorkflow(com.atlassian.jira.user.ApplicationUser, JiraWorkflow) instead. Since v6.0.
| |||||||||||
Deletes all draft workflows (there should every be only one) for a given parent workflow.
| |||||||||||
Given an issue and the identifier if a workflow action, returns the ActionDescriptor associated.
| |||||||||||
Retrieve all currently active workflows.
| |||||||||||
Retrieve a single draft workflow by name.
| |||||||||||
Given an issue and the identifier of a workflow action, returns the next status object for the issue if the action gets executed.
| |||||||||||
Retrieve a map: actions -> post functions for a workflow.
| |||||||||||
Gets the first stepId for the given action and workflow name.
| |||||||||||
Retrieve a single workflow by name.
| |||||||||||
Retrieve the workflow for a given project - issue type pair.
| |||||||||||
This method is deprecated.
Use
getWorkflow(com.atlassian.jira.issue.Issue) instead. Since v6.2.
| |||||||||||
Retrieve the workflow for a given issue.
| |||||||||||
This method returns a JiraWorkflow, that contains a com.opensymphony.workflow.loader.WorkflowDescriptor
that is mutable.
| |||||||||||
Return the workflow in a particular scheme for a given issue type.
| |||||||||||
Return the workflow in a particular scheme for a given issue type.
| |||||||||||
Retrieve all of the workflows in the system
| |||||||||||
Returns all workflows for a given scheme.
| |||||||||||
This method is deprecated.
Since 5.0. Use
getWorkflowsFromScheme(com.atlassian.jira.scheme.Scheme) instead.
| |||||||||||
Retrieve all of the workflows in the system including drafts.
| |||||||||||
Determine whether or not a given workflow is active in the system.
| |||||||||||
Determine whether or not a given workflow is a system workflow.
| |||||||||||
Prepares Workflow object with given user as caller
| |||||||||||
This method is deprecated.
Use
makeWorkflow(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0.
| |||||||||||
Migrates given issue to new workflow and sets new status on it.
| |||||||||||
This method is deprecated.
Please use
migrateIssueToWorkflow(com.atlassian.jira.issue.MutableIssue, JiraWorkflow, com.atlassian.jira.issue.status.Status) .
Since: 3.9.
| |||||||||||
Migrates given issue to new workflow and sets new status on it.
| |||||||||||
Saves the draft workflow into the active workflow.
| |||||||||||
This method is deprecated.
Use
overwriteActiveWorkflow(com.atlassian.jira.user.ApplicationUser, String) instead. Since v6.0.
| |||||||||||
Changes the parameter map of all conditions that have the parameter map matching matchMap by adding all properties from newMap.
| |||||||||||
This method will save the workflow and it will not affect the updatedDate and updatedAuthorName meta attributes
of the workflow.
| |||||||||||
This method is deprecated.
Use
updateWorkflow(com.atlassian.jira.user.ApplicationUser, JiraWorkflow) instead. Since v6.0.
| |||||||||||
Saves the given JiraWorkflow, which may be either a "live" or "draft" version.
| |||||||||||
This method is deprecated.
Use
updateWorkflowNameAndDescription(com.atlassian.jira.user.ApplicationUser, JiraWorkflow, String, String) instead. Since v6.0.
| |||||||||||
Used to change the name and description of an existing worfklow with the given name.
| |||||||||||
This method is deprecated.
Since 5.1. This method should not be used directly by external developers as it is an operation
that only makes sense in the context of a higher level operation in JIRA (i.e. project removal / changing the
workflow scheme of a given project).
Please use the API calls for these higher level operations instead.
Provided a set of workflows, this method will check, if the passed in inactive workflows have any drafts linked to them. If they do, it will copy the draft into a new inactive workflow, and then delete the draft.
user | The user performing the operation |
---|---|
workflows | A set of parent JiraWorkflow s |
@Internal
classes and interfaces can not expect to be compatible with any version
other than the version they were compiled against (even minor version and milestone releases may break binary
compatibility with respect to @Internal
elements).
Provided a set of workflows, this method will check, if the passed in inactive workflows have any drafts linked to them. If they do, it will copy the draft into a new inactive workflow, and then delete the draft.
This method is only meant to be used internally in JIRA. External developers should not call this method directly.
user | The user performing the operation |
---|---|
workflows | A set of parent JiraWorkflow s
|
Clones a workflow by creating a deep copy of the workflow provided.
user | The user performing the operation |
---|---|
clonedWorkflowName | The name to store the new workflow with. |
clonedWorkflowDescription | The description to store with the cloned workflow. Can be null. |
workflowToClone | The workflow to copy. |
This method is deprecated.
Use copyWorkflow(com.atlassian.jira.user.ApplicationUser, String, String, JiraWorkflow)
instead. Since v6.0.
Clones a workflow by creating a deep copy of the workflow provided.
username | The user performing the operation |
---|---|
clonedWorkflowName | The name to store the new workflow with. |
clonedWorkflowDescription | The description to store with the cloned workflow. Can be null. |
workflowToClone | The workflow to copy. |
This method is deprecated.
Use createDraftWorkflow(com.atlassian.jira.user.ApplicationUser, String)
instead. Since v6.0.
This will create an draft workflow of the named active workflow. This draft workflow can be used to edit active
workflows without overwriting the active workflow immediately.
This method will not allow you to create an
draft workflow if the parent workflow is not active, the method will throw an IllegalStateException
in
this case.
username | identifies the user performing the action so that we can keep an audit trail of who has last
saved the workflow. Empty string for anonymous user. If null an IllegalArgumentException will be thrown |
---|---|
parentWorkflowName | identifies the parent workflow that should be used as the template for creating the draft workflow. |
JiraWorkflow
that represents a copy of the parent that can be edited without
overwriting the active workflow immediately.IllegalStateException | thrown if the parentWorkflow is not Active or the draft already exists |
---|---|
IllegalArgumentException | If the username is null |
This will create an draft workflow of the named active workflow. This draft workflow can be used to edit active
workflows without overwriting the active workflow immediately.
This method will not allow you to create an
draft workflow if the parent workflow is not active, the method will throw an IllegalStateException
in
this case.
user | identifies the user performing the action so that we can keep an audit trail of who has last
saved the workflow. Empty string for anonymous user. If null an IllegalArgumentException will be thrown |
---|---|
parentWorkflowName | identifies the parent workflow that should be used as the template for creating the draft workflow. |
JiraWorkflow
that represents a copy of the parent that can be edited without
overwriting the active workflow immediately.IllegalStateException | thrown if the parentWorkflow is not Active or the draft already exists |
---|---|
IllegalArgumentException | If the username is null |
Create an issue in the database.
remoteUserName | Issue creator |
---|---|
fields | Map of fields. The key is the name of the field, and the type of the value depends on the key. Must
include a key "issue", which contains MutableIssue object (holding values, not
yet persisted to disk). May include other fields (eg "pkey"->String key of project, "originalissueobject"->Issue
object) passed onto the workflow engine. |
WorkflowException | If any errors occur while trying to create the issue. |
---|
This method is deprecated.
Use createWorkflow(com.atlassian.jira.user.ApplicationUser, JiraWorkflow)
instead. Since v6.0.
WorkflowException | |
WorkflowException |
Deletes all draft workflows (there should every be only one) for a given parent workflow.
parentWorkflowName | The parentworkflow for which the draft workflow needs to be deleted. |
---|
IllegalArgumentException | if the parentWorkflowName is null |
---|
Exception |
---|
Given an issue and the identifier if a workflow action, returns the ActionDescriptor associated.
issue | The issue. |
---|---|
actionId | The identifier of a workflow action. |
Retrieve all currently active workflows.
WorkflowException | RuntimeException wrapper for any errors. |
---|
Retrieve a single draft workflow by name. If there is not an draft workflow associated with the name this will return null.
parentWorkflowName | is the name of the Saved workflow which identifies then paritally edited draft workflow to retrieve. |
---|
IllegalArgumentException | if no parentWorkflow with the name provided can be found. |
---|
@Internal
classes and interfaces can not expect to be compatible with any version
other than the version they were compiled against (even minor version and milestone releases may break binary
compatibility with respect to @Internal
elements).
Given an issue and the identifier of a workflow action, returns the next status object for the issue if the action gets executed.
issue | The issue |
---|---|
actionId | The identifier of a workflow action |
Retrieve a map: actions -> post functions for a workflow.
workflow | The Workflow |
---|
Gets the first stepId for the given action and workflow name.
actionDescriptorId | id of the ActionDescriptor |
---|---|
workflowName | name of the JiraWorkflow |
StoreException |
---|
Retrieve a single workflow by name. The returned JiraWorkflow
contains a
descriptor that by default isn't mutable.
If you need to edit a workflow, please see getWorkflowClone(String)
.
name | The workflow name |
---|
JiraWorkflow
that wraps an Immutable WorkflowDescriptor or nullRetrieve the workflow for a given project - issue type pair.
projectId | the Project |
---|---|
issueTypeId | the IssueType ID |
WorkflowException | RuntimeException wrapper for any errors. |
---|
This method is deprecated.
Use getWorkflow(com.atlassian.jira.issue.Issue)
instead. Since v6.2.
Retrieve the workflow for a given issue.
issue | the Issue |
---|
WorkflowException | RuntimeException wrapper for any errors. |
---|
Retrieve the workflow for a given issue.
issue | the Issue |
---|
WorkflowException | RuntimeException wrapper for any errors. |
---|
This method returns a JiraWorkflow, that contains a com.opensymphony.workflow.loader.WorkflowDescriptor that is mutable. This method should be called, if you require to edit the workflow.
If you only need to view a workflow, please use getWorkflow(String)
as it will provide better
performance. Cloning a workflow is expensive, as it requires de-constructing and re-constructing the underlying
com.opensymphony.workflow.loader.WorkflowDescriptor from XML.
name | The workflow name |
---|
JiraWorkflow
or null if it doesn't exist.Return the workflow in a particular scheme for a given issue type.
scheme | the Scheme |
---|---|
issueTypeId | the IssueType ID |
WorkflowException | RuntimeException wrapper for any errors. |
---|
Return the workflow in a particular scheme for a given issue type.
scheme | the Scheme |
---|---|
issueTypeId | the IssueType ID |
WorkflowException | RuntimeException wrapper for any errors. |
---|
Retrieve all of the workflows in the system
JiraWorkflow
objects.
Returns all workflows for a given scheme.
workflowScheme | the Workflow Scheme. |
---|
WorkflowException | RuntimeException wrapper for any errors. |
---|
This method is deprecated.
Since 5.0. Use getWorkflowsFromScheme(com.atlassian.jira.scheme.Scheme)
instead.
Returns all workflows for a given scheme.
workflowScheme | the Workflow Scheme. |
---|
WorkflowException | RuntimeException wrapper for any errors. |
---|
Retrieve all of the workflows in the system including drafts. We return a list as we want to keep workflows and associated drafts are adjacent.
JiraWorkflow
objects.
Determine whether or not a given workflow is active in the system.
Active workflows are those currently assigned to schemes and associated with projects - they cannot be edited but can be used.
workflow | the JiraWorkflow to check |
---|
WorkflowException | RuntimeException wrapper for any errors. |
---|
Determine whether or not a given workflow is a system workflow.
Check for a system or XML based workflow - can not be edited.
workflow | the JiraWorkflow to check |
---|
WorkflowException | maybe - but it doesn't look like it? |
---|
Prepares Workflow object with given user as caller
user | caller |
---|
This method is deprecated.
Use makeWorkflow(com.atlassian.jira.user.ApplicationUser)
instead. Since v6.0.
Prepares Workflow object with given username as caller
userName | caller username |
---|
Migrates given issue to new workflow and sets new status on it.
issue | issue to migrate |
---|---|
newWorkflow | new workflow |
status | new status |
WorkflowException | if migration fails |
---|
This method is deprecated.
Please use migrateIssueToWorkflow(com.atlassian.jira.issue.MutableIssue, JiraWorkflow, com.atlassian.jira.issue.status.Status)
.
Since: 3.9.
Migrates given issue to new workflow and sets new status on it.
issue | issue to migrate |
---|---|
newWorkflow | new workflow |
status | new status |
WorkflowException | if migration fails |
---|
Migrates given issue to new workflow and sets new status on it. It returns true iff the issue that was migrated needs a reindex. The passed issue is not reindexed even if necessary.
issue | issue to migrate |
---|---|
newWorkflow | new workflow |
status | new status |
WorkflowException | if migration fails |
---|
Saves the draft workflow into the active workflow.
user | User will be added to the workflows Audit trail |
---|---|
workflowName | The workflow to be overwritten |
This method is deprecated.
Use overwriteActiveWorkflow(com.atlassian.jira.user.ApplicationUser, String)
instead. Since v6.0.
Saves the draft workflow into the active workflow.
username | User will be added to the workflows Audit trail |
---|---|
workflowName | The workflow to be overwritten |
Changes the parameter map of all conditions that have the parameter map matching matchMap by adding all properties from newMap.
transition | transition to change the conditions in |
---|---|
matchMap | the map used to determine if the condition should be modified |
newMap | a map of properties to be added to the parameter map |
This method will save the workflow and it will not affect the updatedDate and updatedAuthorName meta attributes
of the workflow. This should only ever be invoked by system operations such as upgrade tasks. All other saves
should use the method updateWorkflow(String, JiraWorkflow)
workflow | the workflow to save. |
---|
WorkflowException | RuntimeException wrapper for any errors. |
---|
This method is deprecated.
Use updateWorkflow(com.atlassian.jira.user.ApplicationUser, JiraWorkflow)
instead. Since v6.0.
Saves the given JiraWorkflow, which may be either a "live" or "draft" version. This method does not save the
changes to the active workflow. Instead, this is meant to be used to make persistent changes to your working
edit. Once all changes have been made you can over write the active workflow by calling overwriteActiveWorkflow(String, String)
username | User making the request. |
---|---|
workflow | The JiraWorkflow to save. |
IllegalArgumentException | if the workflow or its descriptor is null. |
---|
Saves the given JiraWorkflow, which may be either a "live" or "draft" version. This method does not save the
changes to the active workflow. Instead, this is meant to be used to make persistent changes to your working
edit. Once all changes have been made you can over write the active workflow by calling overwriteActiveWorkflow(ApplicationUser, String)
user | User making the request. |
---|---|
workflow | The JiraWorkflow to save. |
IllegalArgumentException | if the workflow or its descriptor is null. |
---|
This method is deprecated.
Use updateWorkflowNameAndDescription(com.atlassian.jira.user.ApplicationUser, JiraWorkflow, String, String)
instead. Since v6.0.
Used to change the name and description of an existing worfklow with the given name.
username | The user performing the operation |
---|---|
currentWorkflow | The workflow to update. |
newName | The new name to save with the workflow |
newDescription | The new description to save with the workflow |
Used to change the name and description of an existing worfklow with the given name.
user | The user performing the operation |
---|---|
currentWorkflow | The workflow to update. |
newName | The new name to save with the workflow |
newDescription | The new description to save with the workflow |