I am using Scriptrunner Cloud Behaviours to display/hide field based on another field's value.
Field changed and field to be hidden/displayed are of single select type. This field type is supported by behaviours (https://docs.adaptavist.com/sr4jc/latest/features/behaviours).
Based on the documentation, I would want to display the field only if the value of another custom field is true (https://docs.adaptavist.com/sr4jc/latest/features/behaviours/behaviours-api)
While I am able to hide the affected field on load using .setVisible(true), I am unable to display the field on change using .setVisible(false).
Below is my code snippet.
const fieldChangedValue = getFieldById("customfield_10255").getValue().name;
const siteCF = getFieldById("customfield_10254");
if (fieldChangedValue == "Site"){
siteCF.setVisible(true);
}Any advice?