Dear Community,
I would need some help trying to count the elements from a formfield.
I set up a behaviour from scriptrunner, which should only allow one affected version in the ticket.
The list has always the size 0
This is my code:
FormField affectedVersions = getFieldById(AFFECTED_VERSIONS)
List<ProjectComponent> components = affectedVersions.getValue() as List
if (components.size() > 1) {
affectedVersions.setError("Only one affected Version is allowed!")
}
else { affectedVersions.clearError() }
Thanks 
Niklas