Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to set a value to cascade child field via JIRA Rest API

Rene Salomao February 2, 2022

I am testing a payload via Postman to add values into cascade field in issue ticket on JIRA environment (non-Cloud), normally we would pass info as such. 

"customfield": {"value": "Parent", "child": {"value":"Child"}}

However in our existing application, technical team made it impossible to pass information as above and ask us if possible to break down into two lines. Found something similar at "https://community.developer.atlassian.com/t/how-to-set-cascade-custom-field-value-to-ap-jira-opencreateissuedialog-issue/35987" (JIRA Cloud), but did not worked for us:

"customfield": { "value": "Parent" },

"customfield:1": { "value": "Child" }

Is there any other alternative?

 

Thanks.

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Tim Perrault
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.
February 2, 2022

Hi @Rene Salomao 

 

Welcome to the community!

You will need to set the cascade custom field like this:

 

 "customfield_xxxxx": {
"value": "xxxxx",
"child": {
"value": "xxxxx"
}

You will need to replace the Xs

 

Thanks,

Tim

Rene Salomao February 2, 2022

Hi Tim,

The way you propose works when input through Postman, however our application does not allow us to pass info as you described. We would like an alternative as two separated entries. It may works on JIRA Cloud, but we are deployed into client infra...

Example (did not worked):

"customfield": { "value": "Parent" },

"customfield:1": { "value": "Child" }

Tim Perrault
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.
February 2, 2022

I setup a test field for myself to see how it breaks down and also to use real values instead of Xs. It looks like you need to use the Ids for the field and the values.

Does your entry look like the one below?

{"customfield_23910": 25500}

{"customfield_23910:1": 25501}

Rene Salomao February 2, 2022

Hi Tim,

My entry is "customfield_11547": {"value": "Infraestrutura", "child": {"value":"Windows"}}", since it won´t work using existing application, we were looking for something like that but so far no success:

 

"customfield_11547": {"value": "Infraestrutura"},

"customfield_11547:1": {"value":"Windows"}


Error message:

"customfield_11547:1": "Field 'customfield_11547:1' cannot be set. It is not on the appropriate screen, or unknown."

Tim Perrault
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.
February 2, 2022

Try using the ID number for the value. Infraestrutura and Windows have 5 digit IDs that you can use. Should look something like this but replace the Xs with the ID number:

 

{"customfield_11547": xxxxx}

{"customfield_11547:1": xxxxx}

Rene Salomao February 7, 2022

Hi Tim,

We used exacltly like your example, using values or IDs but no success. Checking with tech team if they are able to help us on the other application.

Thanks.

BODDA SAI PRAKASH June 8, 2023

hi Rene,

Did you get this ?

issue.update(fields={
                            field_id : {
                            'value' : 'parent value',
                             'children': { 'value' : 'child value'}             
                          }
                          }
                          )
this code is updating parent but not child value 

any suggestions ?
TAGS
AUG Leaders

Atlassian Community Events