jira-python 0.13 fails to pull error message[s] from failed JIRA.create()

I am (very happily) using the JIRA Python package to access our JIRA, and, have found what looks like an error.

When I access the JIRA server, and have an error (user not in the developer role for that project, or new issue is missing required fields) the package crashes on pulling the error messages.

                    if isinstance(errorMessages, (list, tuple)):
                        error = errorMessages[0]
                    else:
                        error = errorMessages

...this code blows up on the 2nd line, as errorMessages[] is empty. This is in the raise_on_error def in exceptions.

2 answers

Whoops: the error output is:

Traceback (most recent call last):
File "C:\Users\Greg CTR Sudderth\Desktop\Workspaces\Eclipse 4.2 Java EE\Create On Transition (DATA)\CreateOnTransition.py", line 49, in <module>
new_issue = jira.create_issue(project={'key': 'DATA'}, issuetype={'name': 'Data Service Request'})
File "C:\Python27\lib\site-packages\jira\client.py", line 369, in create_issue
raise_on_error(r)
File "C:\Python27\lib\site-packages\jira\exceptions.py", line 29, in raise_on_error
error = errorMessages[0]
IndexError: list index out of range

..the end result is that the program crashes while trying to raise the exception.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

67 views 0 11
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