I'm trying to update an existing JIRA using the jira-python module (http://jira-python.readthedocs.org/en/latest/). Specifically I'm trying to set the fixesVersion list of an issue. I've been trying for a while with no luck. What am I missing?
issue = jira.issue('DUC-391')
issue_dict = { 'fixVersions' : [{'id': '10115'}] }
issue.update(fields=issue_dict)
Returned stackTrace:
Traceback (most recent call last):
File "post-commit-jira.py", line 35, in <module>
issue.update(fields=issue_dict)
File "/Library/Python/2.6/site-packages/jira/resources.py", line 193, in update
super(Issue, self).update(**data)
File "/Library/Python/2.6/site-packages/jira/resources.py", line 72, in update
raise_on_error(r)
File "/Library/Python/2.6/site-packages/jira/exceptions.py", line 29, in raise_on_error
error = errorMessages[0]
Take a look at the example of add, set and remove for components in https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Edit+issues You can use the name instead of the id which is helpful, e.g.
issue_dict = { 'fixVersions' : [{'add': {'name': 'Name of the version 10115'}}] }
Played around more with it, realized the error.
It was failing due to some required fields being unset. Code snipped in the original question is ok, error reporting from the jira-python library however leaves a lot to be desired...
来源:https://stackoverflow.com/questions/14495448/how-do-you-set-the-fixversions-field-using-jira-python