You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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
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:-
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.
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:-
I hope this helps to solve your question. :-)
Thank you and Kind regards,
Ram
Has your question been answered?
If yes, please accept the answer provided.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.