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,559,551
Community Members
 
Community Events
184
Community Groups

Scriptrunner fields hiding/showing based on another field value

Hi,
I have problem with showing/hiding fields based on value chosen in previous field.
I found similar questions on this forum, but every solution that I tried failed. Perhaps its problem with Jira Service Desk version? We're using version 4.6.0 . 
We want to have field 'Vrsta poizvedbe' with few options. When option 'Duplikat is chosen' by costumer on portal field 'Datum predvidenega vračila' is shown. 
Otherwise is hidden. Its like cascadingValues is not 'Duplikat'. Is there a way to see what is in this field than?
Please help.

Annotation 2020-05-29 115222.pngAnnotation 2020-05-29 132335.png

1 answer

1 accepted

1 vote
Answer accepted
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 01, 2020

You have to put the serer-side script on the trigger field, not the target field.

So in this case, add the script to 'Vrsta poizvedbe'

def valuesToCauseHiding = ['Duplikat']
def fieldsToHide = ['customfield_12629']
def triggerField = getFieldById(getFieldChange())

def triggerValue = triggerField.value
fieldsToHide.each{fieldId->
def fieldToHide = getFieldById(fieldId)

fieldToHide.setHidden(triggerValue in valueToCauseHiding)
}

Thank you Peter

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events