How to get the value of cascade custom fields using Jira API?

sunesh May 20, 2013

We are trying to use Jira API to create issues in jira and need to access cascade custom field values of a project using Jira API. Can somebody please share some code samples to achieve this?

Thanks

Sunesh

1 answer

0 votes
Chaithra N
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.
May 20, 2013

If cfvalue is the customfield value, then bel0w steps have to be used to get each options

HashMap<String, Option> hashMapEntries = (HashMap<String, Option>) cfvalue;

Option option1 = hashMapEntries.get(CascadingSelectCFType.PARENT_KEY);

Option option2 = hashMapEntries.get(CascadingSelectCFType.CHILD_KEY);

Chaithra N
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.
May 20, 2013

This applies to JIRA 5.1 +

sunesh May 21, 2013

Thanks for your reply Chaithra, one more question, is there any way to set the cascade custom field value through JIRA API using the "field values" instead of "field ID's" .

Thanks once again

Sunesh

Harry Chan
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.
May 21, 2013

You have to use the IDs. This was done because users wanted to rename the field values. If the values were stored, there would be no way of changing it. You'll have to work out how to map this yourself.

Suggest an answer

Log in or Sign up to answer