Interface WorkflowService

All Known Implementing Classes:
WorkflowServiceImpl

public interface WorkflowService
Provides workflow related service methods
  • Field Details

    • SERVICE

      static final String SERVICE
      See Also:
    • MAX_NUMBER_OF_PROJECTS

      static final String 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_PROJECTS
      Default 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

      com.atlassian.jira.issue.status.Status getWorkflowStatusObject(String statusId)
      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

      com.atlassian.jira.issue.status.Status getStatusByName(String statusName)
      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 search
      query - 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 workflow
      status - 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 user
      workflow - the original workflow
      newName - the new name
      newDescription - 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 user
      workflowName - 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 specified Project.
      Parameters:
      project - the project
      Returns:
      the result
    • doesWorkflowSchemeExist

      @Nonnull ServiceOutcome<Boolean> doesWorkflowSchemeExist(String name)
      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 specified Project. 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

      @Nonnull ServiceOutcome<Boolean> isWorkflowSchemeActive(String name)
      Is the workflow scheme with the specified name active?
      Parameters:
      name - the name
      Returns:
      the result
    • deleteScheme

      @Nonnull ServiceResult deleteScheme(String name)
      Delete a workflow scheme with the specified name
      Parameters:
      name - workflow scheme name
      Returns:
      the result
    • deleteWorkflow

      @Nonnull ServiceResult deleteWorkflow(String name)
      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 provided issues, 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.