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

Can I use a multi select field to conditionally hide fields

This video (Behaviours demo: Conditionally show/hide custom field with ScriptRunner for Jira Cloud) is what I need to do except that the field I am using is a multi select rather than a singe select field.  Can this still be done?

 

https://www.youtube.com/watch?v=-Jt9BIlGcq4

 

Thanks

Jenifer

1 answer

1 accepted

0 votes
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
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 11, 2023

Hi @Jenifer Kuntz

To answer your question, yes, this is doable.

Below is a sample working code for your reference:-

const changedField = getChangeField()
const multiSelect = getFieldById("customfield_10045")
const textField = getFieldById("customfield_10109")
textField.setVisible(true)

const multipleSelect = getFieldById("customfield_10045")
const myJSON = JSON.stringify(changedField.getValue())

if (myJSON.includes('Apple') ) {
textField.setVisible(false)
}

Please note that the sample code above is not 100% exact to your environment. Hence, you will need to make the required modifications.

Below are the screenshots of the Behaviour configuration:-

behaviour_config2.png

 

behaviour_config.png

So, in this example, when the option Apples is selected from the Multi-Select List, the Multi-Line text field will be hidden.

Below are a couple of test screenshots for your reference:-

1. First, I try to create a new issue. When the issue dialog appears, the Text Field(Multi field) is visible by default.

test1.png

 

2. Next, when I select the option Apple from the Multi-Select List, the Text Field (Multi Line) is hidden as expected, as shown in the screenshot below:-

 

test2.png

 

I hope this helps to solve your question. :-)

 

Thank you and Kind regards,
Ram

 

Ram Kumar Aravindakshan _Adaptavist_
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 13, 2023

Hi @Jenifer Kuntz

Has your question been answered?

If yes, please accept the answer provided.

Thank you and Kind regards,

Ram

Thank you Ram, I missed the email.  This is very helpful!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events