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,557,293
Community Members
 
Community Events
184
Community Groups

I want to show/Hide a field(multi line text box) based on option selected in multi select field. I a

Hello,

 

I want to show/Hide a field(multi line text box) based on option selected in multi select field. I am using the below code but this only hides the "multi line text box" but never shows-

////////////

import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import com.atlassian.jira.component.ComponentAccessor


@BaseScript FieldBehaviours behaviours
def reasonForBlock = getFieldById("customfield_11842") //
def flaggedField = getFieldById("customfield_11829") //
def selectedOption = flaggedField.getValue() as String
log.debug "Selected option: $selectedOption"
if (selectedOption.toString().contains("Other")){

reasonForBlock.setHidden(false)
}
else {
if(reasonForBlock.value)
{
reasonForBlock.setFormValue(null)
}
reasonForBlock.setHidden(true)
}

 

Can someone help?

 

Regards,

Priyanka

1 answer

1 accepted

0 votes
Answer accepted
Lih Yao Tiong
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.
Oct 12, 2021

Hello @Priyanka khare

I had tried to run your script, and it's working fine on my end.
Please correct me if I got you wrong, I understand that you wish only to show the field while the "Other" option was selected on the multi-select field.
May I check if the multi-line text box will never show when you select the "other" option on the multi-select field?
Please make sure that you apply your Behaviour script as a server-side script to detect the changes everytime.

hello,Lih Yao

I also want to try the script.Could I know how you run the script or where you run the script.

Lih Yao Tiong
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.
Oct 20, 2021

Hello @Sophia Chen ,

To run this script, you should need to install ScriprtRunner in your Jira.
Like I mentioned, please make sure that you apply this script as a Behaviour server-side script.

I would like to suggest you look at this document to understand how the script will work with Behaviour.

I hope this helps. :) 

Thank you for your answer,Greatly appreciated! However,it‘s too expensive. We might not use this app.

Thanks again for your reply.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events