Can't update issuepicker via REST API

It is possible to set a new value if field is null, but it is not possible to change an existing value, always got 500 server error.

This error in JIRA logs:

[common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service
Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String

I tried all values: null, [], "" - none of them works.

curl -D- \
    -u user:password -X PUT \
    --data '{ "update": {"customfield_12100": [{"set": ""}] }}' \
    -H "Content-Type: application/json" \

1 answer

0 votes

You'll need to delve into the behaviour of the issue picker field type. At a glance, it's expecting a string, not an array, so you'll need to construct a string of the type it is expecting from your array.

If field is blank (null), you are right, I can set field's value by

'{ "update": {"customfield_12100": [{"set": "Some-valid-issue-key"}] }}'

But after (when field is not blank) this gives me 500 error.

'{ "update": {"customfield_12100": [{"set": "Another-valid-issue-key"}] }}'

So I sad, I tried all types (null, empty array, array with values, string) - all give me 500 error.

@Fedor Stepanov - did you figure a workaround for this? I have the same issue updating a Kepler custom issue and the CREATE/INSERT works but the UPDATE gives me the error that you were getting.   The JIRA CLI works but not the REST API.

We tried to set it to NULL (tried to make it go away) so that we can insert a new value but the update to NULL is giving us the same error.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

442 views 8 26
Read article

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