In a "Create Issue" screen I am trying to hide a custom field based on a value of a group picker field. The field should be hidden for all groups apart from a particular group.
I am using the Scriptrunner Behavior plugin.
// Group ID is the group picker field
FormField fieldFF = getFieldByName("Group ID");
String fieldValue = fieldFF.getValue();
if(!"Some Special Group".equals(fieldValue)){
FormField fieldToHideFF = getFieldByName("Initial Severity");
fieldToHideFF.setHidden(true);
}
However when adding both fields to the behavior this does not work. I am setting the group picker field via a http GET parameter.
Thanks in advance!
Edit: Added problem statement