wind wind - 1 year ago 186
Python Question

Is it possible to change jira issue status with python-jira?

I want to change jira issue status with python-jira.The python-jira API is .I can't find any way to do this.
I was trying to use

.But it didn't work.I found Issue status and workflow in .But I still don't know what to do.Can anyone help me out?

Answer Source

I ran into this as well, and unfortunately JIRA's incredible flexibility also makes it a PITA sometimes.

To change the status on a ticket, you need to make a transition, which moves it from one status to the next.

You need to find your transition IDs, then use it like so:

if issue.fields.status in ('open', 'reopened'):
    # Move the ticket from opened to closed.
    jira.transition_issue(ticket, transitionId=131)

jira-python documents discovering and making transitions here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download