Forums

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

Trying to get a field to be hidden or not hidden depending on the selection of a Multi Select List

Aaron Andrade
Contributor
December 16, 2021

**Already asked this question for a Single Select List, that I got to work, but found out we can't change it to a single select and need to make it work for a Multi Select List**

We are trying to make it where a field is hidden on a screen unless one of the two highlighted choices are picked:

image.png

Here is the code that I got to work for the Single Select List in the behaviour Is there anything I can do to make it work for the Multi Select List?:

def apc = getFieldByName("Analysis Provided to Client")
def severity = getFieldById(getFieldChanged())

def selectedOption = severity.getValue() as String

if (severity.getValue() == "No Impact/Task") {
apc.setHidden(true)
}else if(severity.getValue() == "4 - Affects non-critical function (low impact)") {
apc.setHidden(true)
} else if(severity.getValue() == "3 - Affects non-critical function (high impact)") {
apc.setHidden(true)
}else if(severity.getValue() == "N/A"){
apc.setHidden(true)
}else {
apc.setHidden (false)
}

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Jeroen Poismans
Community Champion
October 28, 2020

Hi Andrew,

Might be pointing out something obvious here but have you checked whether the customfield 10202 is on the create/edit view of the issue where it isn't working?

The fact that it does work for subtasks and not on the parent made me think in this direction.

Let me know if this helped!

 

Jeroen

TAGS
AUG Leaders

Atlassian Community Events