Why can I not update customfield via jira-python library (REST API)?

Using jira-python library, I want to update a <user picker> customfield.
My client is connected to jira instance as administrator and the instruction below give me

jira_session.fields() {u'name': u'Assign User to "Update/Re-Update" (MT)', u'searchable': True, u'navigable': True, u'custom': True, u'orderable': True, u'id': u'customfield_10617', u'schema': {u'customId': 10617, u'type': u'user', u'custom': u'com.atlassian.jira.plugin.system.customfieldtypes:userpicker'}}...

I enter the instruction below based on the documentation http://jira-python.readthedocs.org/en/latest/#jira.resources.Resource.update

test_issue = jira_session.issue(issue_key) test_issue.update(fields={'customfield_10600': {'name': 'lambda'}})

Traceback (most recent call last):
    test_issue.update(fields={'customfield_10600': {'name': 'lambda'}}) 
  File "C:\Python27\lib\site-packages\jira\resources.py", line 302, in update
    super(Issue, self).update(async=async, jira=jira, **data)
  File "C:\Python27\lib\site-packages\jira\resources.py", line 174, in update
    raise_on_error(r)
  File "C:\Python27\lib\site-packages\jira\exceptions.py", line 47, in raise_on_error
    raise JIRAError(r.status_code, error, r.url)
jira.exceptions.JIRAError: HTTP 400: "Field 'customfield_10600' cannot be set. It is not on the appropriate screen, or unknown." http://XXX/rest/api/2/issue/12562

I am able to update fields like <assignee>, <description>,... but why did this not work for the user picker custom field?
Did I made an error in the argument given in the update() method?

Thanks in advance.

1 answer

1 accepted

1 vote
The error message is telling you the problem - you haven't got the field on the issue edit screen.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

240 views 1 18
Join discussion

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