Hi Team,
I am trying to create a behaviour based on value from multi select field -basically to hide two field but it's not working somehow:
def dropDown =getFieldByName("Environment")
def dropDown2=getFieldByName("Application")
def MultiselectList = getFieldById(getFieldChanged()) // I tried this alternate statement as well -getFieldByName("Name")
def MultiselectListValue =MultiselectList.value as List
if(MultiselectListValue == ["ABC"]) {
dropDown.setHidden(false)
dropDown2.setHidden(false)
}
Try it like this:
def MultiselectList = getFieldById(getFieldChanged()) // I tried this alternate statement as well -getFieldByName("Name")
def MultiselectListValue =MultiselectList.value as List
def hide = MultiselectListValue.contains("ABC")
def fieldsToHide = ['Environment', 'Application']
fieldsToHide.each{fieldName->
getFieldByName(fieldName).setHidden(hide)
}
It's not working somehow , i want these two drop to be hidden when value is selected as "ABC" in multi select field other wise it should be visible as usual.
Does it matter if the multi select field is project specific ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can try to output some information on your screen for debugging purposes:
def MultiselectList = getFieldById(getFieldChanged()) // I tried this alternate statement as well -getFieldByName("Name")
def MultiselectListValue =MultiselectList.value as List
def hide = MultiselectListValue.contains("ABC")
MultiselectList.setHelpText("Value detected: $MultiselectListValue (${MultiselectListValue.getClass()}) hide=$hide")
def fieldsToHide = ['Environment', 'Application']
fieldsToHide.each{fieldName->
getFieldByName(fieldName).setHidden(hide).setHelpText("Field $fieldName identified. Attempting to set hidden=$hide")
}
What happens when you set that as your server-side script for the Multi Select field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.