updating a list type custom field failed
Added by Brian Wei almost 3 years ago
Greetings everyone!
I'm trying to update a list type custom field, with json like
{'id': xx, "name": "xxxx", "multiple": True, 'value': ['string1', 'string2', 'string3']}]
I sent request using python-redmine. And our redmine version is 4.1.1.stable.
Python code:
redmine.project.update(xx, custom_fields=[{'id': xx, "name": "xxxx", "multiple": True, 'value': ['new_string1', 'new_string2', 'new_string3']}])
Python gave me below error, and the value failed to update. Tried various ways to input the value, but no luck. Thanks in advance for any help!
Traceback (most recent call last):
File "/Users/solidfire/.pyenv/versions/3.8.2/envs/psirt-tools/lib/python3.8/site-packages/redminelib/managers/base.py", line 248, in update
response = self.redmine.engine.request(self.resource_class.http_method_update, url, data=request)
File "/Users/solidfire/.pyenv/versions/3.8.2/envs/psirt-tools/lib/python3.8/site-packages/redminelib/engines/base.py", line 87, in request
return self.process_response(self.session.request(method, url, **kwargs))
File "/Users/solidfire/.pyenv/versions/3.8.2/envs/psirt-tools/lib/python3.8/site-packages/redminelib/engines/base.py", line 182, in process_response
raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: <field name> is not included in the list
Replies (1)
RE: updating a list type custom field failed - Added by Brian Wei almost 3 years ago
Solved. It turned out that one of the values in the list does not exist in the pre-defined list for that field.