APIs to fetch the workflow states present for a workflow

Apoorva Sharma December 6, 2022

Hi Team,

Can someone please suggest the REST API to get all the workflow states that are present for a particular workflow?

1 answer

0 votes
David Freitez
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.
December 6, 2022

Hi @Apoorva Sharma

After reviewing the API, there is an endpoint that you can expand and it will bring you the statuses of the workflow.

API Endpoint: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflow-search-get

Extending the information with the Expansion variable: https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion

Finally, this endpoint should bring you the statuses:

https://xyzxyz.atlassian.net/rest/api/3/workflow/search?expand=statuses

Hopefully this answers your question,
David

Apoorva Sharma January 2, 2023

Hi @David Freitez ,

Thanks for the APIs but they are for jira cloud, We need the ones for Jira data center.

Do you have the APIs for Jira Data Center to get workflow states? 

David Freitez
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.
January 2, 2023

Hi @Apoorva Sharma

You are right, what version of server are using?, so I can update the links.

Apoorva Sharma January 2, 2023

Hi @David Freitez,

We are using Jira version 9.4.0

David Freitez
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.
January 3, 2023

Hi @Apoorva Sharma

Here is the link of the API Documentation for Jira 9.4.0 on server:

https://docs.atlassian.com/software/jira/docs/api/REST/9.4.0/

 As cloud, it also possible to extend the information with the Expansion variable:

image.png

I suggest you to try with the workflow endpoints and see if it is possible to use the expansion variable to retrieve the statuses.

I hope  this sends you into the right direction.

Thanks,
David

Like Apoorva Sharma likes this

Suggest an answer

Log in or Sign up to answer