transition_issue in jira-python failing with TypeError: transition_issue() takes at least 3 arguments (2 given)

Kylie Grahame June 3, 2015

HI,

the code snippet below was previously working, but now is failing with the shown error. I have no idea how to trouble shoot this error since as far as I can tell all required parameters have been passed to the routine:

*** CODE ****

kpi_measurements = jira.search_issues(search_query, maxResults = 500)
kpi_hash = {}
for each_kpi in kpi_measurements:
kpi_hash[each_kpi.fields.customfield_12006] = each_kpi #customfield_12006 is the key of a support project ticket

 # Use the key of the support project ticket to locate the corresponding kpi ticket in the hash table
kpi=kpi_hash.get_key(key)

# If the status of the kpi ticket is not aligned with the status of the support project ticket, transition the kpi ticket
jira.transition_issue(kpi, transitionId=41) 

 

**** ERROR *****

jira.transition_issue(kpi, transitionId=41) # Done transtion, In Progress -> Done
File "/usr/local/lib/python2.7/dist-packages/jira/client.py", line 83, in wrapper
result = func(*arg_list, **kwargs)
TypeError: transition_issue() takes at least 3 arguments (2 given)

 

I have checked the workflow, there are no preconditions, or screens involved, no values that need to be set as far as I can tell. I can log into JIRA and execute this transition as the same user that the python script is using and perform the transition without any problem. It only shows when using the JIRA python api.

 

Any ideas how I can figure out what this routine requires?

 

1 answer

0 votes
Kylie Grahame June 16, 2015

Fixed my issue by updating the notation to jira.transition_issue(kpi, '41') 

It pre-dated the working version so it took a while for me to try it.

Notation described at:

https://jira-python.readthedocs.org/en/latest/ under the 'Transitions' section.

Doh!

Suggest an answer

Log in or Sign up to answer