Change Issue status when changing Workflow

Denis Rousselle September 26, 2023

Hello,

We are migrating all of our Jira projects to a completely new schema.
Given the number of projects (several hundred) I try to automate the procedure as much as possible with REST APIs.
However, I have a problem, I cannot find the correspondence between the new and old Issue statuses.
When making changes manually, this is done via this screen

workflow change.png
I can't find the correspondence between the old and new statuses of the issues

For example, an old workflow looks like this


{
"defaultWorkflow": "SDT Task Workflow 01122018",
"description": "Generated by JIRA Software version 1001.0.0-SNAPSHOT. This workflow scheme is managed internally by Jira Software. Do not manually modify this workflow scheme.",
"draft": false,
"id": 10516,
"issueTypeMappings": {
"10000": "SDT Epic Workflow 01122018",
"10100": "SDT Development Workflow 01122018",
"10101": "SDT Task Workflow 01122018",
"10102": "SDT Sub-task Workflow 01122018",
"10103": "SDT Bug Workflow 15042020"
},
"issueTypes": {
"10000": {
"description": "A big user story that needs to be broken down. Created by JIRA Software - do not edit or delete.",
"hierarchyLevel": 1,
"iconUrl": "https://             .atlassian.net/images/icons/issuetypes/epic.svg",
"id": "10000",
"name": "Epic",
"self": "https://             .atlassian.net/rest/api/3/issuetype/10000",
"subtask": false
},
"10100": {
"avatarId": 10315,
"description": "A user story. Created by JIRA Software - do not edit or delete.",
"hierarchyLevel": 0,
"iconUrl": "https://                .atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium",
"id": "10100",
"name": "Story",
"self": "https://           .atlassian.net/rest/api/3/issuetype/10100",
"subtask": false
},
"10101": {
"avatarId": 10318,
"description": "A task that needs to be done.",
"hierarchyLevel": 0,
"iconUrl": "https://            .atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium",
"id": "10101",
"name": "Task",
"self": "https://               .atlassian.net/rest/api/3/issuetype/10101",
"subtask": false
},

.........
},
"name": "SDT Workflow Scheme",
"self": "https://              .atlassian.net/rest/api/3/workflowscheme/10516"
}


And the new:


{
"defaultWorkflow": "Defect Workflow 1.0.0",
"description": "Default Workflow Scheme for Development",
"draft": false,
"id": 10572,
"issueTypeMappings": {
"10000": "Epic Workflow 1.0.0",
"10100": "Story Workflow 1.0.2",
"10101": "Task Workflow 1.0.0",
"10102": "Sub-Task Workflow 1.0.0",
"10103": "Bug Workflow 1.0.0",
"10319": "XRAY Test Workflow 1.0.0",
"10320": "XRAY Testing Workflow 1.0.0",
"10321": "XRAY Testing Workflow 1.0.0",
"10322": "XRAY Testing Workflow 1.0.0",
"10323": "XRAY Test Workflow 1.0.0",
"10324": "XRAY Testing Workflow 1.0.0",
"10347": "Time Workflow 1.0.0",
"10348": "Meeting Workflow 1.0.0"
},
"issueTypes": {
"10000": {
"description": "A big user story that needs to be broken down. Created by JIRA Software - do not edit or delete.",
"hierarchyLevel": 1,
"iconUrl": "https://                   .atlassian.net/images/icons/issuetypes/epic.svg",
"id": "10000",
"name": "Epic",
"self": "https://                    .atlassian.net/rest/api/3/issuetype/10000",
"subtask": false
},
"10100": {
"avatarId": 10315,
"description": "A user story. Created by JIRA Software - do not edit or delete.",
"hierarchyLevel": 0,
"iconUrl": "https://.                    atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium",
"id": "10100",
"name": "Story",
"self": "https://                .atlassian.net/rest/api/3/issuetype/10100",
"subtask": false
},
"10101": {
"avatarId": 10318,
"description": "A task that needs to be done.",
"hierarchyLevel": 0,
"iconUrl": "https://                          .atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium",
"id": "10101",
"name": "Task",
"self": "https://                  .atlassian.net/rest/api/3/issuetype/10101",
"subtask": false
},

.......
},
"name": "Product: Workflow Scheme",
"self": "https://            .atlassian.net/rest/api/3/workflowscheme/10572"
}


How to find correspondences between old Workflows and the new one?

Thanks for the help.

1 answer

1 accepted

0 votes
Answer accepted
Bert van Dijk _TMC_nl_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2023

Hi @Denis Rousselle ,

 

Are you trying to normalise the workflows to only one or 2 different onces? May I suggest the following?

Create a workflow, workflow scheme and issuetype workflow scheme where all statusses are present. Then migrate to this issuetype workflow scheme for all projects. This can be easily done using the REST API.

Afterwards, change the workflows of that one issuetype workflow scheme to the workflow you would like to have using the GUI.

 

Kind regards,

Bert

Denis Rousselle September 26, 2023

Hi @Bert van Dijk _TMC_nl_ ,

Thanks for your response.

Everything was created by an external company which unfortunately does not take care of automation.
I automated a part, following the protocol provided.

I edited and moved the Issues (story category and Story issuetype), changed the Issue type scheme, changed the Issue type screen scheme, flagged the Issues "On hold" as an impediment and switched the old workflow with new.

I only need to map statuses in case there are existing issues for the mentioned IssueType.
If this is not possible, I would make the script in two parts, one which will stop just before the mapping, and once this is done manually the second part will be executed for the rest:

Change field configuration scheme
Set the context of Effort Category
Set the context of Story Category
Change Roles & Permissions
Set Test coverage in defective mapping for Xray
Create and add a Shared team (not sure if this is possible with the REST API)
Create filters & Boards
Create/update automation rules (REST API ??)

I hope to save a little time, because each migration takes about two hours

Kind regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events