Unable to access cascading field in behaviour script for cloud/ data center.

Crack Jack
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!
February 22, 2024

I am trying to access cascading field in behavior for both cloud and data center, but unable to achieve our requirement.

Is it possible to access cascading field in behavior and based on cascading parent value i need to view/ hide another short text field.

Can I achieve the above requirement ?

2 answers

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2024

Hi Crack Jack,

I can confirm that inside the behaviours feature of ScriptRunner for Jira Cloud, it is impossible to access cascading select list fields.

This is because the UI Modifications API from Atlassian, which Behaviours uses, does not support Cascading Select List fields.

You can see a complete list of what fields are supported inside of behaviours here for reference.

Finally, can you please raise your use case for cascading Select List field support in behaviours here so we can share this feedback with Atlassian to see if they can add support for this type of field in future?

I hope this information helps.

Regards,

Kristian

0 votes
Matt Parks
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 22, 2024

Welcome to the community! In order to get the value of either the first/second this is the basic framework. This is more for for a Script Listener as opposed to a Behavior, but I think the code should work or at least be close:

Map cfVal = issue.getCustomFieldValue(cfCascading) as Map
if (cfVal) {
String valFirst = cfVal.get(null);
// String valSecond = cfVal.get("1");
// List allValues = cfVal.values() as List;

 This assumes that cfCascading is the custom field object for your cascading select list field.

If you want the full code (which I did not write), you can go to the following community post:

https://community.atlassian.com/t5/Jira-Software-questions/Scriptrunner-get-cascading-list-value-then-set-single-select/qaq-p/1552471

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events