How to correct workflow post function in Jira when the configured resolution does not exist
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
The KB explains the post-function behaviour within the Jira workflow when the resolution is no longer present in the instance.
環境
Jira Cloud
診断
If the resolution no longer exists or is in the process of deletion, the post-function that includes this specific resolution name will remove the resolution name and It will display the resolution ID corresponding to the deleted resolution but will not automatically map or add a new resolution that has been designated as a replacement for the old one during its deletion.
原因
As per the current design in Jira cloud, when a resolution is deleted, the references to this resolution persist in workflow post functions. The same behaviour might be seen with other fields, options, labels, groups, users, roles and any other item in the workflow.
ソリューション
To perform a bulk update of the post function across all workflows having the old resolution ID, it is important to note that the workflows using the old resolution ID can be retrieved directly via API.
- Utilize the GET API to retrieve the body of all the workflows where we intend to update the resolution ID. Within the workflow body, include the names of all relevant workflows where you need to update the old resolution ID with the new resolution name.
{ "workflowNames": [ "CC APPROVAL BUTTON", "Copy of BRAND WORKFLOW" ] }
- Once the above step is completed, we can employ basic authentication methods to verify username and API key to run the API.
- Run the API in order to receive a response containing all the workflows.
- Upon obtaining the workflow response, please copy it and paste it into any JSON editor. From there, search for the current ID(eg:which is 10001) and replace it with the new resolution ID(eg:10004).
- It is important to note that we should only update the resolution value. No other values need to be modified. Since there were 2 workflows that need to be updated, so we have to edit the resolution ID at 2 places for each workflow.
ruleKey": "system:update-field", "parameters": { "field": "resolution", "value": "10004", "mode": "" - With these changes made, return to Postman and create a new POST API request specifically designed for updating this field.
- In this post request's body section, utilize the recently edited response and run the API.
- Upon receiving a response, you will notice that the field has been successfully updated.
- Additionally, verify the workflow post function within your instance after discarding any drafts and refreshing as needed.
Note: However, please be aware that the maximum limit per attempt is 20 workflows.