Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,843
Community Members
 
Community Events
168
Community Groups

Change Options in drop down based on another field value using behaviors

Hi Support,

we are using script runner and are trying to implement certain features using behaviours.

one such scenario is that based on the value in one dropdon controlling the values displayed in the second one. Literally a cascading dropdown effect is what we are looking at.

I searched quite a bit and was unable to find any decent article on how this can be acheived , is there a way to get this done?

Regards,

Shankar

 

1 answer

0 votes
Mirek Community Leader Aug 31, 2022

I think that this article might be helpful

https://www.idalko.com/use-behaviour-functionality-script-runner-show-hide-fields/

There is a sample code that looks like this

def dropDown = getFieldById("customfield_10500")
def conditionA = getFieldById("customfield_10501")
def conditionB = getFieldById("customfield_10502")
log.debug("dropdown value" + dropDown.getValue())
 
if (dropDown.getValue() == "a") {
    conditionA.setHidden(false);
    conditionB.setHidden(true);
} else {
    conditionA.setHidden(true);
    conditionB.setHidden(false);
     
}

Also similar question here 

https://community.atlassian.com/t5/Adaptavist-questions/Scriptrunner-Behaviour-show-a-field-when-value-is-selected-in/qaq-p/1869832

Suggest an answer

Log in or Sign up to answer