How can I get the workflow/transition names that are shown in this graph from "View Workflow" via API?
So far, I've tried the following:
So, what am I missing and is it even possible to get that entire workflow with transition names?
Hi @Jordan Bardwell
If you are looking for the full details of the workflow you might appreciate the answer at https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-get-all-workflow-steps-through-rest-api/qaq-p/542091
However lets assume you are wanting to get everything by the API. There are a number of calls which you have already found above that give you different parts of the workflow.
But you need to expand the response to include transitions information
https://tenantname.atlassian.net/rest/api/3/workflow/search?expand=transitionsThere are other expand options documented as
Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include:
transitions For each workflow, returns information about the transitions inside the workflow.
transitions
transitions.rules For each workflow transition, returns information about its rules. Transitions are included automatically if this expand is requested.
transitions.rules
statuses For each workflow, returns information about the statuses inside the workflow.
statuses
statuses.properties
The full documentation is at https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-workflow-search-get
When you use this api it will return information about transitions that looks like this.
{ "id": "5", "name": "In Progress", "description": "Start working on the issue.", "from": [ "10", "13" ], "to": "14", "type": "directed", "screen": { "id": "10000" },
Working through these elements they relate to.
id - the transition ID
name - the shortname used to describe the transition
description - the text displayed in the hover to explain the transition.
from - a list of status IDs from which this transition can be called. (create has an empty list )
to - the destination status ID
type - should always be directed to the best of my knowledge
screen - the ID of any screen to be displayed.
I hope this helps you understand the options available to you.
Phill
Thanks for the reply. I do have one more question.
Is there a way to get the workflowname that a Project uses? So far, I've only found where you can get the workflowscheme, but that does not align with the workflow name.
Hi
So to know the name of the workflow you need to remember that each issue type can have a different workflow (which is why they are collected in a workflow scheme).
So now you have the workflowscheme associated with a project you need to look for the information that provides you with the issuetype and the associated workflow.
You will see a section similar to this in each workflow
"issueTypeMappings": { "10000": "scrum workflow", "10001": "builds workflow" },The number at the front is the ID of the issuetype and the second part is the name of the workflow that is used.
My issueTypeMappings is blank when I GET the workflowscheme by Workflow ID. Where is that supposed to get populated from?
EDIT:
I found we have a default WorkFlow set for that scheme. So i'm assuming all issue types follow the default since there isn't individual ones defined for the different issue types?
It looks like you're new here. Sign in or register to get started.