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?
I think it might actually be easier, if you could post the result of
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" .
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
{
"update": {
"comment": [
{
"add": {
"body": "Bug has been fixed."
}
}
]
},
"transition":
{
"id": "42"
}
}
Without fields, i have 204 but noting happen, i think this custom field is required. What is wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the original problem with a regular select. It takes an "id" field, not "name" or "value".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
}
}
}
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have now verified it in my own test project what really works. Please note this:
1. You always need to use "value", not "name" (for multiselect and select fields). The documentation in the tutorial is not correct.
2. If you use comments in the request this confuses the parser. Don't use comments in the JSON post data
I've got the following working:
{ "fields": { "project": { "key": "TESTDIETER" }, "summary": "This is a test from the jira api", "description": "Some description", "issuetype": { "id": "1" }, "customfield_10000": [ { "value": "Cosy" }, {"value":"Loud"} ], "customfield_10100": { "value": "Brasil" } } }
customfield_10000 is a multiselect field, customfield_10100 is a select list field. This works on 5.1m2 (not tested yet with 5.0.3)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is my new JSON. Also note, the comments were only here in the post. I have no comments in the code.
{
"fields": {
"project": {
"key": "TEST"
},
"summary": "This is a test from the jira api",
"description": "Some description",
"issuetype": {
"id": "1"
},
"customfield_10000": [
{
"value": "1234"
}
],
"customfield_10100": {
"value": "1234"
}
}
}
Now it tells me
{"errorMessages":[],"errors":{"customfield_10000":"Option value '1234' is not valid","customfield_10100":"Option id 'null' is not valid"}}
1234 in this example is a valid value for both fields. That has been verified.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you create the issue manually, can you select the options 1234 bor both fields? If not it might be because the options are not configured in the project specific configuration context of the custom field. In that case of course the JSON request will also fail.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If all the previous fails, you should get information about the valid date on create. Please use this request and post the result so we can check what the valid input is: http://localhost:8090/rest/api/2/issue/createmeta?projectKeys=TEST&expand=project.issuetypes.fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The field in question is not a multiselect. it is just a regular select. i have checked the tutorial, which is why I am here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have almost the same issue.
image2016-9-21 13:38:15.png
Now, when I try to create a bug using cURl, I get error message as
image2016-9-21 13:36:24.png
My jason script is
image2016-9-21 13:39:44.png
But if i do "ID" instead of value im good. its working fine. My requirement is that I should not use ID because if I use ID it will always create a bug only with that ID. So how would i be able to use value instead of ID. Please advice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.