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 ?
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
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.