We use a python script to transition issues through some interaction with our build system. The workflow is like this: an issue is sent to an Enqueued status, the build machine queries a building project for its Enqueued issues, transitions them to a reserved status while they build, and then transitions them toward QA once they're built.
Our python script manages manages these transitions and also adds a comment with the appropriate build number.
It would be more useful for us if we updated a custom field with the fix build number. However, we ran into an issue implementing this in our python script: it appears as though the custom field can't be accessed or updated.
issue.update(fields={'customfield_11900': arg.buildnumber})
This is the error we're getting:
File "BuildToVerifyJira.py", line 47, in <module>
issue.update(fields={'customfield_11900': 123})
File "c:\python27\lib\site-packages\jira\resources.py", line 194, in update
super(Issue, self).update(**data)
File "c:\python27\lib\site-packages\jira\resources.py", line 73, in update
raise_on_error(r)
File "c:\python27\lib\site-packages\jira\exceptions.py", line 42, in raise_on_error
raise JIRAError(r.status_code, error, r.url)
jira.exceptions.JIRAError: HTTP 400: "{u'customfield_11900': u"Field 'customfield_11900' cannot be set. It is not on the appropriate screen, or unknown."}"
We have tried adding the custom field to a screen at every possible place in the workflow, but ran into the same issue.
We have triple-cheked the customfield ID (it was obtained from a JQL query for the field name).
We also tried variations on the arg.buildnumber like:
fields={'customfield_11900': 123})
fields={'customfield_11900': '123'})
fields={'customfield_11900': ['123']})