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,556,460
Community Members
 
Community Events
184
Community Groups

Show/Hide field does not work when multiple options are selected

Good morning,

I have a behavior that uses the value of a multi-select drop down field to show another text field when selected, however; when any other value in the multi-select field is also selected, the behavior does not work.   

Any ideas on what I can do to correct this?

def accessPoints = getFieldByName("Access Points")
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def accessPointsField = customFieldManager.getCustomFieldObject(accessPoints.getFieldId())
def accessPointsConfig = accessPointsField.getRelevantConfig(getIssueContext())
def accessPointsOptions = optionsManager.getOptions(accessPointsConfig)
def other = getFieldByName("Other, explanation required access")


if (accessPoints.value == "Other (add detail to access request explanation)") {
 other.setHidden(false)
} else {
other.setHidden(true)
}

I'm sure it is something simple. I just can't seem to figure it out.

 

Thanks!

1 answer

1 vote
Danyal Iqbal
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.
Jun 25, 2018
accessPoints.value.contains("Other (add detail to access request explanation)") 

Try this.

It did not like that option:other error.png

Roland Holban (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.
Jun 25, 2018 • edited

You can ignore that error.

Groovy is a dynamic language, which means all method and property names are looked up when your code is run, not when it’s compiled, unlike Java. Because of this, the static type checker is not always correct. It is a best-efforts attempt to let you know if there are problems with your code.

Thank you both for the assist! This is working as expected now.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events