I written this script for the multiselect field for the option visibility, when I select Option 1 in multiselect field it is going to if condition and if I select both the options in multiselect field it is not passing to else statement still stays in the "1st If condition of OPTION1"
I'm looking in a way when I select multiple option in multiselect field it should directly move to else statement by skipping the if conditions and if I select the single option it should look to IF condition
Below is the code I written
const changeField = getChangeField()
const field = getFieldById("customfield_10079") --->multiselect field id
if(changeField.getName() == "Select List (Multi)")
{
let podName = field.getValue()
let value = podName.map(c => c.value)
if(value.toString().includes("Option 1")){
getFieldById("customfield_10047").setOptionsVisibility(["10130","10026"],true)
}
else if(value.toString().includes("Option 2")){
getFieldById("customfield_10047").setOptionsVisibility(["10027"],true)
}
else{
getFieldById("customfield_10047").setOptionsVisibility(["10026", "10027", "10130", "10154"],true)
}