Am writing a custom HTML form to create issues in JIRA via the REST API (rest/api/2/issue). One of the fields is a custom JIRA field with multiple options (single select), but I'm unable to create issues when I include that in the JSON. The error I'm receiving is "Could not find valid 'id' or 'value' in the Parent Option object. The JSON I'm supplying looks like:
{ "fields": { "project": { "key": "PTP" }, "customfield_10401": "my project request", "customfield_11700": "11610", "summary": "my project request", "description": "Compliance Program", "issuetype": { "name": "Epic" } } }
where "customfield_11700" is the single select custom field. (customfield_10401 is "Epic Name").
The supplied id "11610" is a valid ID (known value) for the custom field - I retrieved it from the createmeta API.
I've tried to create an issue by supplying the 'ID' and the 'value' for the customfield_11700 with no success. I now the customfield_11700 is the offender because if I remove the 11700 field from the JSON, the issue is created successfully.
Any ideas on what I should try?
Try this:
"customfield_11700": { "value": "Compliance" }
I am facing same problem in jsd server apis.
I setting custome field value using FieldID and InputFieldValue classes.
input fields working as expected but select field not working.
It shows above error.
for input field i do following things.
FieldId fID = FieldId.withId("1");
fVlaue = FieldInputValue.withValue("asd");
for select customfield field i do following things.
FieldId fID = FieldId.withId("2");
fVlaue = FieldInputValue.withValue(FieldInputValue.withValue("selectedoption");
please help where i am wrong.
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.
try passing the value and not the id. See examples here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jobin, thanks for the suggestion and the link, but no luck. I tried a number of variations in the JSON, but I conclude there's something special about single select fields. Here's what I tried:
1. JSON using 'value' for customfield (FAIL):
{ "fields": { "project": { "key": "PTP" }, "customfield_11700": "Compliance", <--- using value "summary": "my project request", "description": "project description", "issuetype": { "name": "Epic" } } }
{ "fields": { "project": { "key": "PTP" }, "customfield_11700": "11610", <--- using id "summary": "my project request", "description": "project description", "issuetype": { "name": "Epic" } } }
3. JSON using sqaure brackets (as shown in the examples) (FAIL):
{ "fields": { "project": { "key": "PTP" }, "customfield_11700": ["Compliance"], <--- using value in brackets "summary": "my project request", "description": "project description", "issuetype": { "name": "Epic" } } }
But then, I tried to update a custom field of type text - and that SUCCEEDED:
{ "fields": { "project": { "key": "PTP" }, "customfield_10600": "Compliance", <--- using text field "summary": "my project request", "description": "project description", "issuetype": { "name": "Epic" } } }
SOOO, that's what gets me to the conclusion that the single/multiple selects are expecting something different.
thoughts?
-Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
were you able to find a solution ? i am having the same problem
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.