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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi community, how can I hide the second part of Cascading custom field? I would like to hide the second part base on the selected value of the first part.
For example, I have a field "Dept" and it contains names of all departments.
I would like to hide the sub-value part of the field. Once the user selects Technology then it should show the second sub-value part (Database, Development, Support). I tried the below behaviour script but it didn't work. Any idea how can I make it work?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.fields.config.FieldConfig
import com.atlassian.jira.issue.customfields.option.Options
import com.atlassian.jira.bc.project.component.ProjectComponent
import com.onresolve.jira.groovy.user.FieldBehaviours
def primaryField = getFieldById("customfield_13200")
def subField = getFieldById("customfield_13200:1") //not sure sub value part can be define like this
if (primaryField.value == "Technology") {
subField.setHidden(false) }
else {
subField.setHidden(true)
}
Thank you for your help.
Hi @Shah Baloch ,
unfortunately you can't hide just the second part of your cascading select list.
Your code is incorrect!
def subField = getFieldById("customfield_13200:1") //not sure sub value part ca
In order to take value of second part of your field :
def subField = primaryField.getValue().get("1")
You can change or set that second part value but you can't hide just the second part.
My suggestion is to set a None value for all values in second part where there are no values.
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.