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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,414,280
Community Members
 
Community Events
170
Community Groups

Script for hiding a field based on the select list value

Hi,

I have written a script regarding hiding a number field based on the values in the select list custom field. But it is throwing an error.

Could you please help me on this.

Regards,

Suseela

1 comment

Ganesh Babu Community Leader Jan 28, 2020

Hi @GSuseela 

Are you using a scriptrunner for this? In that case i will provide you a script which works

This hides a Text Field based on what value is in a Single Select List

def textField = getFieldByName("TextFieldB")
def selectList = getFieldByName("SelectListA")

def selectListValue = selectList.getValue()

if (selectListValue == "AAA") {
textField.setHidden(true)
} else {
textField.setHidden(false)
}

This Behaviour is meant to go on the field you are basing the Behaviour on. In your example, you want to hide the Field A based on Field B. So the Behaviour should be put on Field B so that it is triggered every time the field is changed.  

Like # people like this

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events