//File: src/JiraStuff/groovy/M/ToBePaid_ValidateMaxLengthNumeric.groovy //Field: % to be Paid - customfield_10530 //Description: Validate max length and numeric String strVal = getFieldById(getFieldChanged()).getValue().toString() if( strVal.length() > 0 ) { strVal.find("[^0-9]|.{4,}") || strVal.toInteger() > 100 ? getFieldById(getFieldChanged()).setError('This field only allows 3 numeric characters and no more than 100') : getFieldById(getFieldChanged()).clearError(); } else { getFieldById(getFieldChanged()).clearError(); }