Jira Python API Transitions

2.8k views Asked by At

I'm trying to use the Python Jira API to set transition fields but I can't seem to get it through the API call. Some transitions have required fields and I want to be able to add comment/change some of the fields. However, the API isn't giving me the list of required fields for each transition. Some of them have no fields and I have no problem transitioning with those transitions. However, for some transitions like Clean, there are fields inside before you complete the transition. For example, I want to be able to change the resolution for this transition from Fixed to Won't Fix. I can change it manually by looking at the values and doing the transition with the value I want, but this is not ideal. I want to be able to look at all the possible values and be able to choose whichever one the user wants to pick for the resolution. enter image description here

I'm using this code from the JIRA Python API which gives me all the names but not any of the required fields and the values associated with the fields.

issue = jira.issue('PROJ-1')
transitions = jira.transitions(issue)
[(t['id'], t['name']) for t in transitions] 
1

There are 1 answers

0
andyong5 On

To get all the fields, you need to add this.

transitions = jira.transitions(issue, expand="transitions.fields")