This resource represents workflow schemes. Use it to manage workflow schemes and the workflow scheme's workflows and issue types.

A workflow scheme maps issue types to workflows. A workflow scheme can be associated with one or more projects, which enables the projects to use the workflow-issue type mappings.

Active workflow schemes (workflow schemes that are used by projects) cannot be edited. When an active workflow scheme is edited, a draft copy of the scheme is created. The draft workflow scheme is then be edited and published (replacing the active scheme).

See Configuring workflow schemes for more information.

Hierarchy

  • CommonHttpService
    • WorkflowSchemesService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns WorkflowSchemesService

Methods

  • Creates a workflow scheme.

    Permissions required: Administer Jira global permission.

    Parameters

    Returns Promise<WorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "draft": false,
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    }

    POST /rest/api/3/workflowscheme @scopes-current manage:jira-configuration @scopes-beta write:workflow-scheme:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira, read:workflow-scheme:jira

  • Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow (the jira workflow).

    Note that active workflow schemes cannot be edited. If the workflow scheme is active, set updateDraftIfNeeded to true and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme can be published in Jira.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          updateDraftIfNeeded?: boolean;
      }
      • id: number

        The ID of the workflow scheme.

      • OptionalupdateDraftIfNeeded?: boolean

        Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to false.

    Returns Promise<WorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "draft": false,
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    }

    DELETE /rest/api/3/workflowscheme/{id}/default @scopes-current manage:jira-configuration @scopes-beta read:workflow-scheme:jira, write:workflow-scheme:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira

  • Deletes the workflow-issue type mapping for a workflow in a workflow scheme.

    Note that active workflow schemes cannot be edited. If the workflow scheme is active, set updateDraftIfNeeded to true and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft workflow scheme can be published in Jira.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          updateDraftIfNeeded?: boolean;
          workflowName: string;
      }
      • id: number

        The ID of the workflow scheme.

      • OptionalupdateDraftIfNeeded?: boolean

        Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to false.

      • workflowName: string

        The name of the workflow.

    Returns Promise<void>

    DELETE /rest/api/3/workflowscheme/{id}/workflow @scopes-current manage:jira-configuration @scopes-beta delete:workflow-scheme:jira

  • Deletes the issue type-workflow mapping for an issue type in a workflow scheme.

    Note that active workflow schemes cannot be edited. If the workflow scheme is active, set updateDraftIfNeeded to true and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft workflow scheme can be published in Jira.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          issueType: string;
          updateDraftIfNeeded?: boolean;
      }
      • id: number

        The ID of the workflow scheme.

      • issueType: string

        The ID of the issue type.

      • OptionalupdateDraftIfNeeded?: boolean

        Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the workflow scheme cannot be edited. Defaults to false.

    Returns Promise<WorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "draft": false,
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    }

    DELETE /rest/api/3/workflowscheme/{id}/issuetype/{issueType} @scopes-current manage:jira-configuration @scopes-beta delete:workflow-scheme:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira, read:workflow-scheme:jira, read:workflow:jira

  • Returns a paginated list of all workflow schemes, not including draft workflow schemes.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          maxResults?: number;
          startAt?: number;
      } = {}
      • OptionalmaxResults?: number

        The maximum number of items to return per page.

      • OptionalstartAt?: number

        The index of the first item to return in a page of results (page offset).

    Returns Promise<PageBeanWorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "isLast": true,
    "maxResults": 50,
    "startAt": 0,
    "total": 2,
    "values": [
    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    },
    {
    "defaultWorkflow": "jira",
    "description": "The description of the another example workflow scheme.",
    "id": 101011,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Another example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101011"
    }
    ]
    }

    GET /rest/api/3/workflowscheme @scopes-current manage:jira-configuration @scopes-beta read:workflow-scheme:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira

  • Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue types that have not been mapped to any other workflow. The default workflow has All Unassigned Issue Types listed in its issue types for the workflow scheme in Jira.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          returnDraftIfExists?: boolean;
      }
      • id: number

        The ID of the workflow scheme.

      • OptionalreturnDraftIfExists?: boolean

        Set to true to return the default workflow for the workflow scheme's draft rather than scheme itself. If the workflow scheme does not have a draft, then the default workflow for the workflow scheme is returned.

    Returns Promise<DefaultWorkflow>

    Returned if the request is successful.

    example:

    {
    "workflow": "jira"
    }

    GET /rest/api/3/workflowscheme/{id}/default @scopes-current manage:jira-configuration @scopes-beta read:workflow-scheme:jira, read:workflow:jira

  • Returns the workflow-issue type mappings for a workflow scheme.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          returnDraftIfExists?: boolean;
          workflowName?: string;
      }
      • id: number

        The ID of the workflow scheme.

      • OptionalreturnDraftIfExists?: boolean

        Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned.

      • OptionalworkflowName?: string

        The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow.

    Returns Promise<IssueTypesWorkflowMapping>

    Returned if the request is successful.

    example:

    {
    "defaultMapping": false,
    "issueTypes": [
    "10000",
    "10001"
    ],
    "workflow": "jira"
    }

    GET /rest/api/3/workflowscheme/{id}/workflow @scopes-current manage:jira-configuration @scopes-beta read:workflow-scheme:jira, read:workflow:jira, read:issue-type:jira

  • Returns a workflow scheme.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          returnDraftIfExists?: boolean;
      }
      • id: number

        The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as schemeId. For example, schemeId=10301.

      • OptionalreturnDraftIfExists?: boolean

        Returns the workflow scheme's draft rather than scheme itself, if set to true. If the workflow scheme does not have a draft, then the workflow scheme is returned.

    Returns Promise<WorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "draft": false,
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    }

    GET /rest/api/3/workflowscheme/{id} @scopes-current manage:jira-configuration @scopes-beta read:workflow-scheme:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira

  • Returns a list of workflow schemes by providing workflow scheme IDs or project IDs.

    Permissions required:

    • Administer Jira global permission to access all, including project-scoped, workflow schemes
    • Administer projects project permissions to access project-scoped workflow schemes

    Parameters

    • params: {
          expand?: string;
          workflowSchemeReadRequest: WorkflowSchemeReadRequest;
      }
      • Optionalexpand?: string

        Deprecated. See the deprecation notice for details.

        Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include:

        • workflows.usages Returns the project and issue types that each workflow in the workflow scheme is associated with.
      • workflowSchemeReadRequest: WorkflowSchemeReadRequest

    Returns Promise<WorkflowSchemeReadResponse[]>

    Returned if the request is successful.

    example:

    [
    {
    "defaultWorkflow": {
    "description": "This is the default workflow for Software Development projects.",
    "id": "3e59db0f-ed6c-47ce-8d50-80c0c4572677",
    "name": "Default Software Development Workflow",
    "usage": [
    {
    "issueTypeIds": [],
    "projectId": "10047"
    }
    ],
    "version": {
    "id": "657812fc-bc72-400f-aae0-df8d88db3d9g",
    "versionNumber": 1
    }
    },
    "description": "This is the workflow scheme for the Software Development project type.",
    "id": "3g78dg2a-ns2n-56ab-9812-42h5j1464567",
    "name": "Software Developer Workflow Scheme",
    "projectIdsUsingScheme": [
    "10047"
    ],
    "scope": {
    "project": {
    "id": "10047"
    },
    "type": "GLOBAL"
    },
    "taskId": "3f83dg2a-ns2n-56ab-9812-42h5j1461629",
    "version": {
    "id": "527213fc-bc72-400f-aae0-df8d88db2c8a",
    "versionNumber": 1
    },
    "workflowsForIssueTypes": [
    {
    "issueTypeIds": [
    "10013"
    ],
    "workflow": {
    "description": "This is the workflow for the Software Development bug issue type.",
    "id": "5e79ae0f-ed6c-47ce-8d50-80c0c4572745",
    "name": "Software Development Bug Workflow",
    "usage": [
    {
    "issueTypeIds": [
    "10013"
    ],
    "projectId": "10047"
    }
    ],
    "version": {
    "id": "897812dc-bc72-400f-aae0-df8d88fe3d8f",
    "versionNumber": 1
    }
    }
    }
    ]
    }
    ]

    POST /rest/api/3/workflowscheme/read @scopes-current manage:jira-configuration @scopes-beta read:workflow-scheme:jira

  • Sets the workflow for an issue type in a workflow scheme.

    Note that active workflow schemes cannot be edited. If the workflow scheme is active, set updateDraftIfNeeded to true in the request body and a draft workflow scheme is created or updated with the new issue type-workflow mapping. The draft workflow scheme can be published in Jira.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          issueType: string;
          issueTypeWorkflowMapping: IssueTypeWorkflowMapping;
      }
      • id: number

        The ID of the workflow scheme.

      • issueType: string

        The ID of the issue type.

      • issueTypeWorkflowMapping: IssueTypeWorkflowMapping

        The issue type-project mapping.

    Returns Promise<WorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "draft": false,
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    }

    PUT /rest/api/3/workflowscheme/{id}/issuetype/{issueType} @scopes-current manage:jira-configuration @scopes-beta write:workflow-scheme:jira, read:workflow-scheme:jira, read:workflow:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira

  • Sets the default workflow for a workflow scheme.

    Note that active workflow schemes cannot be edited. If the workflow scheme is active, set updateDraftIfNeeded to true in the request object and a draft workflow scheme is created or updated with the new default workflow. The draft workflow scheme can be published in Jira.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          defaultWorkflow: DefaultWorkflow;
          id: number;
      }
      • defaultWorkflow: DefaultWorkflow

        The new default workflow.

      • id: number

        The ID of the workflow scheme.

    Returns Promise<WorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "draft": false,
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    }

    PUT /rest/api/3/workflowscheme/{id}/default @scopes-current manage:jira-configuration @scopes-beta read:workflow-scheme:jira, write:workflow-scheme:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira

  • Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for the workflow scheme. Unmapped issues types are mapped to the default workflow.

    Note that active workflow schemes cannot be edited. If the workflow scheme is active, set updateDraftIfNeeded to true in the request body and a draft workflow scheme is created or updated with the new workflow-issue types mappings. The draft workflow scheme can be published in Jira.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          issueTypesWorkflowMapping: IssueTypesWorkflowMapping;
          workflowName: string;
      }
      • id: number

        The ID of the workflow scheme.

      • issueTypesWorkflowMapping: IssueTypesWorkflowMapping
      • workflowName: string

        The name of the workflow.

    Returns Promise<WorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "draft": false,
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    }

    PUT /rest/api/3/workflowscheme/{id}/workflow @scopes-current manage:jira-configuration @scopes-beta write:workflow-scheme:jira, read:workflow-scheme:jira, read:workflow:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira

  • Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft workflow scheme is created or updated instead, provided that updateDraftIfNeeded is set to true.

    Permissions required: Administer Jira global permission.

    Parameters

    • params: {
          id: number;
          workflowScheme: WorkflowScheme;
      }
      • id: number

        The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as schemeId. For example, schemeId=10301.

      • workflowScheme: WorkflowScheme

    Returns Promise<WorkflowScheme>

    Returned if the request is successful.

    example:

    {
    "defaultWorkflow": "jira",
    "description": "The description of the example workflow scheme.",
    "draft": false,
    "id": 101010,
    "issueTypeMappings": {
    "10000": "scrum workflow",
    "10001": "builds workflow"
    },
    "name": "Example workflow scheme",
    "self": "https://your-domain.atlassian.net/rest/api/3/workflowscheme/101010"
    }

    PUT /rest/api/3/workflowscheme/{id} @scopes-current manage:jira-configuration @scopes-beta read:workflow-scheme:jira, write:workflow-scheme:jira, read:application-role:jira, read:avatar:jira, read:group:jira, read:issue-type:jira, read:project-category:jira, read:project:jira, read:user:jira

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void