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,556,259
Community Members
 
Community Events
184
Community Groups

How Hide/Show Cascading Field Value?

Edited

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.

  • Customer Service
  • Human Resource
  • Sales
  • Technology
    • Database
    • Development
    • Support
  •  Quality Assurance   

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.

1 answer

1 accepted

0 votes
Answer accepted
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 07, 2022

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events