Hi so i have been trying to hide a field when my previous field has a particular selection out of a list of three namely None, sick, casual
I want the reason for the leave field to be hidden in case type of leave is sick or casual
in case it is None i want it to be accesible
Ive been trying behaviour but had no luck maybe im going wrong somewhere if someone could guide me thank you
-----------------------------
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def approver = getFieldByName("reason for the leave")
def tOL = getFieldById(getFieldChanged())
def selectedOption = tOL.getValue() as String
if (selectedOption == "None") {
approver.setHidden(true)
} else {
approver.setHidden(false)
}