Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Limiting field characters using the behaviors plugin

Scott Federman July 29, 2020

I have a field that I am limiting to no more than 25 characters using the behaviors plugin. The rule works when you try to exceed 25 characters from an edit screen. However, from the view screen you can still change it to exceed 25 characters. Is it possible to fix this so that it simply cannot exceed 25 characters from any screen?

def field = getFieldByName("Use Case Product")
if ((field?.value as String)?.length() > 25) {
field.setError("Length of the field should be less than 25 chars")
} else {
field.clearError()
}

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events