I have 2 custom fields named "Contract type" and "Legal Reviewer" where "Contract type" is a single choice select list (2 options: Template, Non-template) and "Legal Reviewer" is a single user picker.
Currently "Legal Reviewer" is set as hidden. I want to show it when user choose "Non-template" for "Contract type" on the create screen.
Here's my attempt:
def fieldToHide = getFieldByName("Legal Reviewer")
def contractCf = getFieldByName("Contract type")
def optionValue = contractCf.getValue().toString()
fieldToHide.setHidden(true)
if (optionValue == 'Non-template') {
fieldToHide.setHidden(false)
}There are no errors shown but the script doesn't work. When I choose "Non-template" the field "Legal Reviewer" doesn't show up. Any idea what I did wrong here? Thanks in advance.