I use jira cloud and from the rest api, want update workflow transition property. How can you do that in a workflow that is active ?.Can I change the status of the workflow to draft and then to active?
thanks.
Hi Victor,
I understand that you're using the REST API in Jira Cloud and want to be able to update a workflow transition on an active workflow. Unfortunately, there is actually not a means to do exactly what you want today. I refer to the documentation we have in Update workflow transition property PUT /rest/api/3/workflow/transitions/{transitionId}/properties. From that page:
workflowMode
string
The workflow status. Set to
live
for inactive workflows ordraft
for draft workflows. Active workflows cannot be edited.Valid values:
live
,draft
It's that 'Active workflows cannot be edited' part that you will see over and over again in that developer documentation in relation to workflows. In short, you cannot make this change directly to an active workflow. You can only make this change to an inactive workflow or a draft of a workflow. If you ignore this limitation and try anyways, you get back an error like this in the REST response:
{"errorMessages":["The workflow you are trying to update is not editable."],"errors":{}}
But what you can do is use that workflowMode and choose draft, this will take an active workflow and make the change to a draft of it. That doesn't publish the changes, but it does get you one step closer.
In my example this looked like this when I used this via curl:
curl --request PUT \
--url 'https://[mycloudsite].atlassian.net/rest/api/3/workflow/transitions/21/properties?key=examplePropertyKeyHere&workflowName=abcScrum&workflowMode=draft' \
--header 'Authorization: Basic [redacted]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"value": "propertyValueHere"}'
This works, but again, this only created a draft workflow. There is no way for you to currently publish a draft workflow, nor is there a means to make an inactive workflow active via REST API. So I created a feature request that specifically seeks to do that in JRACLOUD-74270 - As a Jira admin, I want to be able to publish drafts and activate inactive workflows to make changes via the REST API.
Sorry there does not appear to be a means do this via the REST API today. You can still login to the Jira web interface as an admin and publish this draft that way to make these changes active. I know that isn't what you are looking for, but I don't believe we have a means to do that today in the REST API.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.