Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to figure out setting custom field version picker value via API

Tim College November 19, 2019

Hi there - I'm trying to figure out setting (adding, really) a value to a custom field in Jira Cloud.  I've used both API v2 and v3, both return a 204 response code, but neither actually updates the field.

Actually, that's untrue - if the field already has a value, it deletes it without adding a new value, which in a way, is worse :(

The custom field is a version picker, and I have verified that the version I'm testing with exists and is accepted as a valid value via the UI.

I'm using a PHP REST client specifically for Jira - https://github.com/lesstif/php-jira-rest-client, and this is what I can see about the actual request being made:

Curl PUT: https://mycompant.atlassian.net/rest/api/3/issue/IWTIM-6341? JsonData={"fields":{"customfield_14525":[{"value":"5.1.15-1112"}]}}

Changing another, non-custom field as part of the same request works for the non-custom field, but not for the custom one:

Curl PUT: https://mycompany.atlassian.net/rest/api/3/issue/IWTIM-6341? JsonData={"fields":{"priority":{"name":"Major"},"customfield_14525":[{"value":"5.1.15-1112"}]}}

 In addition to the version name, I've tried the version id, and even the index of the allowedValues when looking at the issue's editMeta resource

Any thoughts/hints?

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Tim College November 19, 2019

And of course I figure it out seconds after posting.  "value" was the incorrect...index?...to use in the custom field - changing that to "name" works as expected.

Suggest an answer

Log in or Sign up to answer