Custom Field validation

Pramod Kutty February 6, 2014

I am trying to validate a custom field using a groovy script .

if(subpayrate < billrate)

{

log.warn("Submission Pay Rate is less than billrate");

invalidInputException = new InvalidInputException("fixVersions", "Fix Version/s is required when specifying Resolution of \"Fixed\"")

}

I have initialized the invalidInputException but the transition is not failing.
How do you fail the transition on field validation failure

1 answer

0 votes
Marten Kreienbrock
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 13, 2014

do you just initialize the Exception, or do you also throw it?

I'm personaly not quite familiar with Groovy, but in Java an exception would also have to be thrown:

throw new InvalidInputException("Something went wrong");

Also, where exactly do you execute your code? Inside a Validator class?

Suggest an answer

Log in or Sign up to answer