Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL or REST API call to retrieve all possible workflow stages for an issue?

Michael Gruskin November 8, 2019

In my Jira instance, we have a workflow field for our issues. Depending on the type of issue (Bug, Story, Spike, etc...) the steps in this workflow differ. The steps in the workflow can be seen in a graph by pressing a view workflow link in the top of the issue on the web interface. These steps are typically along the lines of:

Await work -> Do work -> Check Work -> Commit Work -> Validate and Test

Or something along those lines, depending on the issue type.

I'm not sure if this is something custom that my company pulls from a plugin, or if this is standard to Jira.

I'm trying to use JQL and the REST API to specify a project and issue type combination, and get a list of all possible steps in the workflow for that combo. The endpoint I'm currently using is:

/rest/api/2/issue/createmeta?projectKeys=myProjectKey&issuetypeNames=Bug&expand=projects.issuetypes.fields

This works for some of the fields in my issue, getting me closer to the data I need, but it leaves out others, including the workflow one that I care about.

Could anyone point me in the right direction for how I might get the data I need?

1 answer

1 accepted

1 vote
Answer accepted
Hana Kučerová
Community Champion
November 8, 2019

Hi @Michael Gruskin,

welcome to the Atlassian community!

 

I've searched in Jira Server REST API documentation and found only:

/rest/api/2/project/{projectIdOrKey}/statuses

You can use this endpoint to get all issue types with valid status values for a project.

https://docs.atlassian.com/software/jira/docs/api/REST/8.5.1/#api/2/project-getAllStatuses

But there is no information about available transitions.

 

I was able to find only one endpoint, which could give you information about transitions, but you must provide the issue key:

/rest/api/2/issue/{issueIdOrKey}/transitions

https://docs.atlassian.com/software/jira/docs/api/REST/8.5.1/#api/2/issue-getTransitions

Michael Gruskin November 11, 2019

Hi Hana,

Thank you so much for your answer, I somehow missed the statuses endpoint, which was exactly what I needed! I was able to use that API response to get the data I needed. Thank you again!

Suggest an answer

Log in or Sign up to answer