We have a custom field where we want to get inputs between 1-10 only, and inputs apart from this range should give error message. So when we put incorrect value it gives the error message but after clearing the incorrect value and trying to keep the field blank it still throws error message.
This is the script which we are using:
def abvField = getFieldById("customfield_12404")
def abvValue = getFieldById("customfield_12404").getValue() as Integer //Actual Business Value
if (abvValue > 10 || abvValue <1 )
{
abvField.setError("This field should contain a number value between 1-10")
}
else { abvField.clearError()}