Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to hide child options in a cascading field

Andrey Goryunov
Contributor
August 28, 2023

I have a task to hide child values for a cascading custom field for a specific customer request type
I hide parent options from a cascading field with script runner behaviours


import com.atlassian.jira.component.ComponentAccessor
def reqType = getRequestTypeName()
def issueCategory = getFieldById("customfield_11000")
def tempcat
def tempcat2
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObject(issueCategory.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
def optionToSelect
if (reqType == 'Req type name') {
    tempcat = "Parent value"
    tempcat2 = ""
    issueCategory.setFormValue([tempcat,tempcat2])
    optionToSelect = options.findAll { it.value in ["Parent value"]}
issueCategory.setFieldOptions(optionToSelect)
}

but i can't hide child options.

To make it clearer, I have a cascading field in which there is a parent value A and child values A1, A2, A3. I need to hide the value of A2.

Maybe someone can help me solve this problem.

Thank you.

1 answer

0 votes
Marc - Devoteam
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.
August 28, 2023
Andrey Goryunov
Contributor
September 4, 2023

Hi @Marc - Devoteam , your links send to articles where it is described how to hide parent values, I can do this myself. Unable to hide values in child lists.

Suggest an answer

Log in or Sign up to answer