[
{
"self": "https://<site>.atlassian.net/rest/api/3/customFieldOption/13860",
"value": "value1",
"id": "13860"
},
{
"self": "https://<site>.atlassian.net/rest/api/3/customFieldOption/13861",
"value": "value2",
"id": "13861"
}
]
So I got the ids and values of each field.
Let's say my field now has only value1 and I want to add value 2.
Here is the curl call I do.
curl --request PUT --url 'https://<site>.atlassian.net/rest/api/3/issue/IPP-150?notifyUsers=false' --user '<email>:<token>' --header 'Accept: application/json' --header 'Content-Type: application/json' \
--data '{
"update": {
"customfield_14841": [
"add": [
{
"id": "13861"
}
]
]
}
}'
Unfortunately this results in the following error
{"errorMessages":["Can not instantiate value of type [simple type, class com.atlassia
n.jira.rest.api.issue.FieldOperation] from JSON String; no single-String constructor/
factory method (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdate
Bean[\"update\"])"]}
If I add brackets surrounding the "add" key (as seen in some docs), I get the following one:
{"errorMessages":["There was an error parsing JSON. Check that your request body is v
alid."]}
How to properly write the update block?
Thanks.