Interface WorkflowService
- All Known Implementing Classes:
WorkflowServiceImpl
public interface WorkflowService
Provides workflow related service methods
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionassociateSchemeToProject
(com.atlassian.jira.project.Project project, com.atlassian.jira.scheme.Scheme scheme) Associates scheme to projectassociateWorkflowToSchemeAsDefault
(String workflowName, com.atlassian.jira.scheme.Scheme scheme) Associates a workflow to the given scheme, makes it the default workflow for that schemeServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow>
copyWorkflow
(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.workflow.JiraWorkflow workflow, String newName, String newDescription) Creates a new copy of the existing workflow, with the specified name and description.deleteScheme
(String name) Delete a workflow scheme with the specified namedeleteWorkflow
(String name) Delete a workflow with the specified name.Does a workflow scheme with the specified name exist?Set<com.atlassian.jira.issue.status.Status>
getAccessibleStatuses
(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query) Get the list of accessible statuses for issues potentially returned by the current query.Set<com.atlassian.jira.issue.status.Status>
Get all active workflow statuses available in the systemSet<com.atlassian.jira.issue.status.Status>
Get all workflow statuses available in the systemCollection<com.atlassian.jira.workflow.JiraWorkflow>
getJiraWorkflows
(com.atlassian.jira.project.Project project) Given a project, returns all JIRA workflows which are associated to that project Empty on errorCollection<com.atlassian.jira.workflow.JiraWorkflow>
getJiraWorkflows
(com.atlassian.jira.project.Project project, String issueTypeId) Given a project and an issue type id, returns the JIRA Workflow which is associated to that project for that issue type Empty on errorSet<com.atlassian.jira.workflow.JiraWorkflow>
getJiraWorkflows
(Set<com.atlassian.jira.issue.Issue> issues) Given a set of issues, returns the JIRA Workflows which are associated to those issuescom.atlassian.jira.issue.status.Status
getStatusByName
(String statusName) Get a status given its namegetTransitions
(com.atlassian.jira.user.ApplicationUser user, List<Long> projectIds) Get the transitions data for the given projects This will have the workflows for each project and issue type pair.ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow>
getWorkflow
(com.atlassian.jira.user.ApplicationUser user, String workflowName) Retrieve the workflow with the specified nameOptional<com.atlassian.jira.scheme.Scheme>
getWorkflowSchemeForProject
(com.atlassian.jira.project.Project project) Returns the scheme currently associated to the specifiedProject
.ServiceOutcome<Collection<com.atlassian.jira.workflow.JiraWorkflow>>
getWorkflowsForProject
(com.atlassian.jira.project.Project project) Retrieve the workflows that are in use for the specifiedProject
.com.atlassian.jira.issue.status.Status
getWorkflowStatusObject
(String statusId) Get the status object for a given idisStatusInitialStatus
(com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status) Is this status the initial status for this workflow?isWorkflowSchemeActive
(String name) Is the workflow scheme with the specified name active?
-
Field Details
-
SERVICE
- See Also:
-
MAX_NUMBER_OF_PROJECTS
Property for maximum number of projects you can fetch transitions for- See Also:
-
DEFAULT_MAX_NUMBER_OF_PROJECTS
static final int DEFAULT_MAX_NUMBER_OF_PROJECTSDefault maximum number of projects you can fetch transitions for- See Also:
-
-
Method Details
-
getAllWorkflowStatusObjects
Set<com.atlassian.jira.issue.status.Status> getAllWorkflowStatusObjects()Get all workflow statuses available in the system -
getAllActiveWorkflowStatusObjects
Set<com.atlassian.jira.issue.status.Status> getAllActiveWorkflowStatusObjects()Get all active workflow statuses available in the system -
getWorkflowStatusObject
Get the status object for a given id- Parameters:
statusId
- the id to look up- Returns:
- a status object or null if the id is invalid
-
getStatusByName
Get a status given its name -
getAccessibleStatuses
@Nonnull Set<com.atlassian.jira.issue.status.Status> getAccessibleStatuses(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query) Get the list of accessible statuses for issues potentially returned by the current query. In effect we are asking, "What projects and issue types could be returned by this query for this user, and what statuses are linked to workflows assigned to those projects and issue types?".- Parameters:
user
- the user who would be performing the searchquery
- the query being asked about- Returns:
- the list of statuses
-
isStatusInitialStatus
@Nonnull ServiceOutcome<Boolean> isStatusInitialStatus(@Nonnull com.atlassian.jira.workflow.JiraWorkflow workflow, @Nonnull com.atlassian.jira.issue.status.Status status) Is this status the initial status for this workflow?- Parameters:
workflow
- the workflowstatus
- the status- Returns:
- the result
-
copyWorkflow
@Nonnull ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> copyWorkflow(com.atlassian.jira.user.ApplicationUser user, @Nonnull com.atlassian.jira.workflow.JiraWorkflow workflow, @Nonnull String newName, @Nonnull String newDescription) Creates a new copy of the existing workflow, with the specified name and description.- Parameters:
user
- the userworkflow
- the original workflownewName
- the new namenewDescription
- the new description- Returns:
- the new workflow
-
getWorkflow
@Nonnull ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> getWorkflow(com.atlassian.jira.user.ApplicationUser user, @Nonnull String workflowName) Retrieve the workflow with the specified name- Parameters:
user
- the userworkflowName
- the workflow name- Returns:
- the result
-
getWorkflowsForProject
@Nonnull ServiceOutcome<Collection<com.atlassian.jira.workflow.JiraWorkflow>> getWorkflowsForProject(com.atlassian.jira.project.Project project) Retrieve the workflows that are in use for the specifiedProject
.- Parameters:
project
- the project- Returns:
- the result
-
doesWorkflowSchemeExist
Does a workflow scheme with the specified name exist?- Parameters:
name
- the name- Returns:
- the result
-
getWorkflowSchemeForProject
@Nonnull Optional<com.atlassian.jira.scheme.Scheme> getWorkflowSchemeForProject(com.atlassian.jira.project.Project project) Returns the scheme currently associated to the specifiedProject
.null
will be the result if there is no scheme associated (i.e. the Default Scheme is in use).- Parameters:
project
- the project- Returns:
- the result
-
isWorkflowSchemeActive
Is the workflow scheme with the specified name active?- Parameters:
name
- the name- Returns:
- the result
-
deleteScheme
Delete a workflow scheme with the specified name- Parameters:
name
- workflow scheme name- Returns:
- the result
-
deleteWorkflow
Delete a workflow with the specified name.- Parameters:
name
- workflow name- Returns:
- the result
-
getJiraWorkflows
@Nonnull Collection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project project) Given a project, returns all JIRA workflows which are associated to that project Empty on error -
getJiraWorkflows
@Nonnull Collection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project project, String issueTypeId) Given a project and an issue type id, returns the JIRA Workflow which is associated to that project for that issue type Empty on error -
getJiraWorkflows
@Nonnull Set<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(@Nonnull Set<com.atlassian.jira.issue.Issue> issues) Given a set of issues, returns the JIRA Workflows which are associated to those issues- Parameters:
issues
- Set of issues to get workflows from- Returns:
- A set of all the
JiraWorkflow
objects associated to the providedissues
, or an empty set if no workflows could be found.
-
associateWorkflowToSchemeAsDefault
@Nonnull ServiceResult associateWorkflowToSchemeAsDefault(String workflowName, com.atlassian.jira.scheme.Scheme scheme) Associates a workflow to the given scheme, makes it the default workflow for that scheme -
associateSchemeToProject
@Nonnull ServiceResult associateSchemeToProject(com.atlassian.jira.project.Project project, com.atlassian.jira.scheme.Scheme scheme) Associates scheme to project -
getTransitions
@Nonnull ServiceOutcome<WorkflowService.WorkTransitions> getTransitions(com.atlassian.jira.user.ApplicationUser user, List<Long> projectIds) Get the transitions data for the given projects This will have the workflows for each project and issue type pair. A project will be omitted if the user does not have permission to view it or it is not present.
-