I'm trying to create a Scriptrunner Behavior that displays a custom field based on the value in an Assets Object custom field.
This script works if both fields are regular custom fields. It also works as-is to hide the text field, but doesn't display the field when the expected option is selected.
def cf1 = getFieldByName("[ASSET OBJECT FIELD NAME]")
def cf2 = getFieldByName("[CUSTOM MULTI-LINE TEXT FIELD NAME")
def cf1Value = cf1.value as String
if (cf1Value == "[ASSET OBJECT FIELD VALUE]") {
cf2.setHidden(false)
cf2.setRequired(true)
} else {
cf2.setHidden(true)
cf2.setRequired(false)
}Any help is greatly appreciated!
Thank you