Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Other field is not visible

Baris June 17, 2021

I'm using the scriptrunner to Create a Select List With Other behaviour.

The idea was to select "other" in the prevoiusly created custom field and the script should have populate the single line text field custom field.

 

def otherFaveField = getFieldByName("Favourite Fruit (Other)")

def faveFruitField = getFieldById(getFieldChanged())

def selectedOption = faveFruitField.getValue() as String

def isOtherSelected = selectedOption == "Other"

otherFaveField.setHidden(!isOtherSelected)

otherFaveField.setRequired(isOtherSelected)

 

When I create the behaviour and add the mapping the Favorite Fruit (Other) single line text field does not appear. Any ideas ?

The documentation what I'm trying to achieve here.

Thanks

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Max Lim _Adaptavist_
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.
June 17, 2021

The script should work fine.

The steps to reproduce is as followed:

1. You should have a custom select list field named "Favourite Fruit", with some options including "Other". Another custom text field named "Favourite Fruit (Other)".

2. Both fields are configured to show on the screens. You use Behaviour to hide them as needed.

3. Navigate ScriptRunner > Behaviours > create a behaviour > edit > add mapping to your project.

4. Add field: choose "Favourite Fruit" > add server side script > use the script.

I hope this helps!

Baris June 18, 2021

Thanks it worked.

TAGS
AUG Leaders

Atlassian Community Events