The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Keshavan Babu
May 12, 2017

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Mirek
Community Champion
August 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

TAGS
AUG Leaders

Atlassian Community Events