I'm trying to create an issue with custom fields. I have a custom field that is a selectlist. I pass in the following JSON:
{ "fields": { "project": { "key": "KEY" }, "summary": "This is a test from the jira api", "description": "Some description", "issuetype": { "id": "1" }, "customfield_1": [ { "id": "1234" } ], "customfield_2": [ // THIS IS THE SELECTLIST { "name": "1234" } ] }}
I get back: Could not find valid 'id' or 'value' in the Parent Option object.
I've tried several different variations, none of which have worked. What is the correct way of sending a value for a custom selectlist?
please also note that you have to use "name" if the field is a single select custom field and no [ ... ] brackets.
EDIT: The tutorial is not correct regarding the example for select lists. If you want to provide the custom field option value by name one has to use the attribute "value", not "name". At least this is the behaviour i have observed in 5.1m2
I tried that and I get the same error. Here is the JSON as it looks now:
{ "fields": { "project": { "key": "KEY" }, "summary": "This is a test from the jira api", "description": "Some description", "issuetype": { "id": "1" }, "customfield_1": [ { "id": "1234" } ], "customfield_2": { // THIS IS THE SELECTLIST "name": "1234" } }}
It's just to add clarity, not to confuse. The exact types of the custom fields that are in question are commented in the example. The one giving me issues is a select list, or drop down list if you prefer.
I think it might actually be easier, if you could post the result of
http://localhost:8090/rest/api/2/issue/createmeta?projectKeys=KEY&issuetypeIds=1&expand=project.issuetypes.fields
I can actually use
"customfield_10000":[{"value":"First Value"},{"value":"Second Value"}]
and
"customfield_10200":{"value":"Four"}
customfield_10000 is a of the type "Multi Select" and customfield_10200 is of the type "Select List" .
(And I can use "id" as well)
What grates on my nerves is that with the "built in" field types the key is "name" and with the custom fields it's "value" .
I had the original problem with a regular select. It takes an "id" field, not "name" or "value".
Hi, i have custom multiselect field, this my POST:
{
"update": {
"comment": [
"add": {
"body": "Bug has been fixed."
}
]
},
"transition":
"id": "42"
"fields":
"customfield_10313": [{ "value": "10360" }]
But i have 400 error.If i POST
Without fields, i have 204 but noting happen, i think this custom field is required. What is wrong?
It looks like you're new here. Sign in or register to get started.