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,560,643
Community Members
 
Community Events
185
Community Groups

Trying to get a field to be hidden or not hidden depending on the selection of a Custom Field

Edited

Hi all,

this is my behavior and I don't know why dosent work:

 

def field1 = getFieldById("customField_20600")

def field2 = getFieldById("customField_10001")

def fieldValue = field2.value()

   if( fieldValue == "my chooise"){

field1.setHidden(false)

} else {

field1.setHidden (true)

}

       When in the issue I compile field2 with my choose,  field1 remain in hide

 

thx in advance for your time                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

 

 

2 answers

1 accepted

0 votes
Answer accepted
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 31, 2022

Hi @Davide Cascapera Apply Scriptrunner behaviour on Field 2 :- 

Try below script it should work :- 

def field1 = getFieldById("customField_20600")

def field2 = getFieldById("customField_10001")



 if( field2.getValue()== "my chooise"){

field1.setHidden(false)

} else {

field1.setHidden (true)

}

  Thanks

V.Y

Hi Vikrant thx for ur suggestion but doesnt work, I tried now and the field1 continued to stay in hiding when I select "my chooise" in field2

Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 31, 2022

Hi @Davide Cascapera  i have tested the script on my machine , Script is working fine :- 

Have you applied behaviour script on Select list field ? 

 

def application = getFieldByName("Application Count")//Select list field

def description = getFieldByName("Description")//text field

if (application.getValue() == "1"){

    description.setHidden(false)

} else {

    description.setHidden(true)

}

before dependent leave I should see  a field named Settlements

I know that the syntax is correct and the behavior should be working, I think maybe there is another bheavior goes in conflict with mine

Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 31, 2022

@Davide Cascapera  Thanks for the screenshot,  Custom Request Type is not a Custom field, this is Scripted field or Programmatically field, that's why behaviour is not working. 

Like Davide Cascapera likes this

Thank you very much for the help Vikrant !!!!!

Like Vikrant Yadav likes this
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 31, 2022

You’re Welcome 😊

Happy to help!

Like Davide Cascapera likes this
0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 31, 2022

Hi @Davide Cascapera 

From the script you provided, I'll take it that you are working on server, rather than on cloud that you have stated in this thread. I'll change the tags.

oh my bad sry! ty for changed tags

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events