How to reproduce workflow diagram myself via REST APIs

Carlos H April 26, 2024

Here I have a simple workflow associated with my issue.

 

Screenshot 2024-04-26 at 9.20.11 AM.png

I want to know how I can obtain this workflow data programmatically via REST API. https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-transitions-get (/rest/api/2/issue/{issueIdOrKey}/transitions) is close to what I need. It shows me what transitions are available and any rules or conditions set. Unfortunately, this doesn't give me the complete picture I need. Given this example, if the issue is currently in "Open" and I were to call the API, I only see one entry in the response for "In Progress". I don't see "Done" listed. Likely because "Done" isn't a permissible transition until the issue has been moved to "In Progress".

 

So what API exists that allows me to look at all the transitions available? Essentially what I'd like to accomplish here is the ability to reproduce this workflow diagram as it's presented in jira for myself via the REST APIs.

1 answer

1 accepted

1 vote
Answer accepted
Michael Wohlgemuth
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.
April 26, 2024

Hello!

This documentation might be of help.

regards

Carlos H April 26, 2024

Yup, that's it. More specifically, the following URL query gives me what I need https://{subdomain}.atlassian.net/rest/api/2/workflow/search?expand=transitions,statuses&workflowName={workflowName}

Carlos H April 26, 2024

@Michael Wohlgemuthdo you know how to accomplish this same request, but with Jira Server? I need to accomplish this on that type of instance as well.

Michael Wohlgemuth
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.
April 30, 2024

Hello Carlos,

probably a combination of this request and this one.

regards

Carlos H April 30, 2024

In order to call `GET /rest/api/2/workflow/{id}/properties`, I need the id. But when I call `GET /rest/api/2/workflow`, it doesn't give me any ids.

Suggest an answer

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

Atlassian Community Events