I'm updating a custom time field, customfield_10000.
When I set this field via the web interface, and do a REST call to get the issue, data is returned in the field.
When I try http://localhost/rest/api/latest/customFieldOption/10000 however, I get the response:
{ "errorMessages": [ "A custom field option with id '10000' does not exist" ], "errors": {} }
Even weirder, when I try to set the value,
{ "update": { "customfield_10000": [ { "set": { "value": "2013-10-28T18:17:00.000-0700" } } ] } }
I get the error
{ "errorMessages": [], "errors": { "customfield_10000": "Operation value must be a string" } }
Can someone offer some insight as to what is exactly going on here?
Community moderators have prevented the ability to post new answers.
So, looking at the documentation (https://docs.atlassian.com/jira/REST/latest/#d2e1272) I guess that you should PUT JSON like that:
{ "fields": { "customfield_10000": "2013-10-28T18:17:00.000-0700" } } |
The command below:
curl -X PUT -H 'Content-Type: application/json' -u admin:admin http://my-test-instance/rest/api/2/issue/TST-77 -d '{"fields":{"customfield_11000":"2013-10-28T18:17:00.000-0700"}}'
Worked fine for me, so the given JSON body should be fine.
Afaik the "update" part of JSON body is for adding/deleting items (like comment or worklog), not for setting field values like date-time. A bit confusing but that's how it works.
Ah man I didnt notice. It should be parent object Fields not Update. My mistake. Thank you Aleksander!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Custom field option is not the same that custom field. Custom field option is for example an item in single select field.
If you want set value of customfield you need to edit issue (PUT for issue resource) or transition it if your field is on the proper screen (but I guess that you want just update issue).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you mind explaining why the Json I have above is not working? I am performing a PUT request to http://localhost/rest/api/latest/issue/SI-3965 with the Json above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it helps, here is the editmeta for my issue:
"customfield_10000": { "required": false, "schema": { "type": "datetime", "custom": "com.atlassian.jira.plugin.system.customfieldtypes:datetime", "customId": 10000 }, "name": "First Observed", "operations": [ "set" ] },
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.