Change Workflow Scheme for multiple Jira Projects
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Changing the workflow scheme for multiple projects at once in Jira Cloud requires careful planning, as there is no native bulk change feature for this specific action in the Jira UI. However, this can be efficiently managed using Jira’s REST API
Prerequisite
- Ensure you have the necessary permissions to change workflow schemes. - Manage Project Permissions
- Obtain API tokens for authentication. - Manage API Tokens
- Workflow schemes have already been created. - Configure Workflow Scheme
Solution
Let's assume, you want to switch between Workflow Scheme A to Scheme B in several projects at once, follow the steps below:
Step 1: Identify the Workflow Scheme IDs:
- Retrieve the IDs for Workflow Scheme A and Workflow Scheme B using the following API endpoint:
- GET /rest/api/2/workflowscheme - Get all workflow schemes
- https://your-atlassian-site.net/rest/api/2/workflowscheme
This will list all workflow schemes in your Jira instance. Note down the IDs for Scheme A and Scheme B.
Step 2: Get a List of Projects Using Scheme A:
- Use the following API endpoint to list all projects associated with a workflow:
- GET /rest/api/2/workflowscheme/project - Get workflow scheme project associations
- https://your-atlassian-site.net/rest/api/2/workflowscheme/project
Filter the projects to identify which ones are using Workflow Scheme A.
Step 3: Change Workflow Scheme for Each Project:
- For each project identified in the previous step, use the following API call to update the workflow scheme to Scheme B:
- PUT /rest/api/2/workflowscheme/project - Assign workflow scheme to project
- Example payload:
- payload = ( { "projectId": "10001", "workflowSchemeId": "10032" } )
Step 4: Automate this process using a script to iterate through the list of projects and update them accordingly.
The above process can be automated using some python scripting. Sample scripts are provided in the Jira REST API documentation
Using the Jira REST API is the most efficient way to change the workflow scheme for multiple projects at once, especially if you have a large number of projects. For smaller numbers, manually updating through the Jira UI is feasible. Ensure you have the necessary permissions and API tokens before proceeding with the API method.