jira.transition_issue fails with internal server error

I'm trying to use the python interface to transition the state of a set of issues in an automated fashion.


It's lless than clear to me how to even get an issue to go from say an open state to a todo or further in the the workflow.

jira.transition_issue(issue, '10000') 

10000 came from jirashell and printing out the issue.fields.status.id value of a card which I'd taken from the open to the todo state.  So by the logic I ought to be able via python to take a card in an open state and likewise transition it to 10000, aka todo.  It fails with:


the error : 

  File "/usr/local/lib/python2.7/site-packages/jira/client.py", line 93, in wrapper

    result = func(*arg_list, **kwargs)

  File "/usr/local/lib/python2.7/site-packages/jira/client.py", line 1098, in transition_issue

    url, data=json.dumps(data))

  File "/usr/local/lib/python2.7/site-packages/jira/resilientsession.py", line 81, in post

    return self.__verb('POST', url, **kwargs)

  File "/usr/local/lib/python2.7/site-packages/jira/resilientsession.py", line 74, in __verb

    raise_on_error(r, verb=verb, **kwargs)

  File "/usr/local/lib/python2.7/site-packages/jira/utils.py", line 120, in raise_on_error

    r.status_code, error, r.url, request=request, response=r, **kwargs)

jira.utils.JIRAError: JiraError HTTP 500

 text: Internal server error

2 answers

1 accepted

0 votes
Accepted answer

Here's the python solution, which is what I'm working with.  The transition IDs are part of the Workflow view, but not everyone can see those IDs. In my case I can see the graph but JIRA doesn't actually display what the IDs are in order to make it work.

So one must do a little reverse engineering. 

If you visit : https://your.url.here/rest/api/2/issue/SOMEISSUE-XX/transitions

And then take that output and drop it in here : http://jsonviewer.stack.hu

resulting in something like ....

"id": "811",
"name": "To Do",
    "to": {


You'll note that for the start of each section is an id and a number. Those are the numbers that you need and they CAN be different so you'll want to look at an issue in every one of the states and dump out their transitions to see what the ids are. 

So for me 

jira.transition_issue(issue, '811')   moves an object from Open to ToDo.


Now I will mention that you ought to be able to get this info out of jira.transitions(issue) but alas my Python isn't that great and that object that comes back it wasn't obvious to me how to walk through the structure....  

Try something like this:

import com.atlassian.jira.workflow.WorkflowTransitionUtil;
import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl;
import com.atlassian.jira.util.JiraUtils;
import com.atlassian.crowd.embedded.api.User;
WorkflowTransitionUtil workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class );
workflowTransitionUtil.setAction (101); // 101 == Transition ID

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,300 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you