Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating new issues with Select List (cascading) field using JIRA REST API

Plotnik_ Guy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 6, 2021

I'm trying to inject a new JIRA issue using JIRA REST API. with JSON format 
Generally it works, however it doesn't work when a "Select List (cascading)" field is missing the child value (to be specific the field has only parent values but no defined children).

The JSON line looks like this: "customfield_22222": {"value": "Test", "child": {"value":"None"} }

And the received error is: {"errorMessages":[],"errors":{"customfield_22222":"Child Option value 'None' is not valid"}}

Using other child values such as null, "", etc. also didn't solve it.
Will be glad to learn from your experience.

1 answer

1 accepted

5 votes
Answer accepted
Thomas Deiler
Community Champion
May 6, 2021

Dear @Plotnik_ Guy ,

welcome to the comunity.

I just wrote a new article for your: How to set select lists (single, multiple, cascading), radio or checkboxes on create issue with REST

So long and thanks for accepting my answer

Thomas

Plotnik_ Guy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 8, 2021

Thank Thomas, it worked!
Much appreciated!
Guy

Jelle Hutting
Contributor
December 29, 2021

Thanks, helped.

Marcelo Ignacio Cid Abud
Contributor
August 3, 2022

@Thomas Deiler 

 

Hi,

I am creating an automation that when a bug type issue is created, the "Category by type of issue" field (cascade list) is edited with the first option Bug and the second option Incident.
However it doesn't work for me

"fields": {
"Category by type of issue" : { "value": "Bug", "child": { "value" : "Incident"} }
}

Do you know what I'm doing wrong?

Srikanth Ganipisetty
Contributor
August 3, 2022

Your is looking good to me, have you find any error logs/messages that was posted when you tried this? 

Your JSON should look like : 

{
"fields": {
  "project": {
"key": "REST"
},
  "summary": "Issue created from REST API",
  "issue type": {
"id": "1"
},
  "customfield_10300": {
"value": "Mammal",
"child": {
"value": "Elephant"
}
}
  }
}
Marcelo Ignacio Cid Abud
Contributor
August 4, 2022

Srikanth Ganipisetty 

I have this problem 

 

Captura de pantalla 2022-08-04 101150.png

Anne Saunders
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2022

I'm having this exact same issue in a single select custom field - 'Task Type' is the name of Custom Field #10097, and the value I'm passing it is an exact option from the ones available on my custom field config screen, but I still get this:

Truncated server response: {"errorMessages":[],"errors":{"customfield_10097":"Specify a valid 'id' or 'name' for Task Type"}}

 I've tried passing "id": "6" since it's the 6th one in the list - no dice.

I've tried passing both id and value as the numeric id (10195) associated with my option. Still nothing.

Suggest an answer

Log in or Sign up to answer