Hello,
I'm trying to manage feedback information by adding a custom field named as "External/Internal Feedback" checkbox with "External" and "Internal" options.
If "External" is selected than "External Feedback Responsible" text field will be displayed on the screen. Else if "Internal" is selected than "Internal Feedback Responsible" user picker will be displayed on the screen.
Until now, everything goes fine thanks to my script that written on Behaviors page as you can see below.
However, if I want to select both options nothing disappears because I guess getFieldById(getFieldChanged()) method pulls the last chenged option. It does not keep both of them.
How can I perform this function? I want to see both "Internal Feedback Responsible" and "External Feedback Responsible" if both options are selected.
Thanks a lot.
Hi @Özge K_ , I think the value returned from the field of checkbox type is String (when one value is seleted) or ArrayList (when multiple values are selected). You can check https://library.adaptavist.com/entity/control-form-field-based-on-selected-checkbox-value.
You need to adjust your script to work with the variables correctly. Focus on following part in the snippet
def checkBoxField = getFieldById(fieldChanged)
def checkBoxFieldValue = checkBoxField.value
def chosenValuesList = []
if (checkBoxFieldValue in String) {
chosenValuesList.add(checkBoxFieldValue)
} else if (checkBoxFieldValue in ArrayList) {
chosenValuesList.addAll(checkBoxFieldValue)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.