JQL Result API, How to get field options separately?

Parvaneh Zand
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.
June 12, 2023

Hi everyone,

I'm using jira api to get jql search result.

List of fields are:

  "fields": [

    "summary",

    "customfield_14951"

  ]

and result for customfield_14951 which is "Select List (cascading)" is :
"customfield_14951": {

                    "self""https://localhost/rest/api/2/customFieldOption/15529",

                    "value""PARENT",

                    "id""15529",

                    "child": {

                        "self""https://localhost/rest/api/2/customFieldOption/16706",

                        "value""CHILD",

                        "id""16706"

                    }

                }
Question: How to get parent and child values separately? I tried
"customfield_14951[1]"
"customfield_14951.value"
to get 'PARENT' value.
and
"customfield_14951[3]['value']"
"customfield_14951.child.value"
to get 'CHILD' value.
none of them works:) Can anyone help me please?

1 answer

1 accepted

0 votes
Answer accepted
Radek Dostál
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.
June 12, 2023

The short story is you can't.

The long story is the value is a map, so splitting it makes no sense and also there is no useful reason to even do it, if you need to handle the values separately, it likely shouldn't be a cascading list.

The longer story is whatever it is you're doing with json, there should be no problem to get the child value from the nested json in much the same way as you got the field from it in the first place.

Parvaneh Zand
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.
June 14, 2023

Thank you @Radek Dostál 

Suggest an answer

Log in or Sign up to answer