Does InvalidInputException not work for verison 6.2.1?

Matt Havemann August 1, 2016

I'm trying to make a custom script validator to cause about 10 fields to be required based on the input of 1 field, so I started off messing around with making a loop to issue errors to all these fields, but over time I started to get suspicious because no matter what I wrote, the transition would go through just fine and the log says there was no errors.

So what I did was just make a simple input validation script to test.

if (issue.getCustomFieldValue(signatureNeeded) == "Yes){
    throw new InavlidInputException("Signature Needed", "Signature Needed is required")
}

 I went in the issue, set the value to Yes, and sent it to Peer Review and it still went through. I don't know what I'm doing wrong, or if it's just broken, and I really don't want to have to make a bunch of simple script validators to set requirement.

 

And before you ask, I know I can use behaviors, but currently my tasking is to re-create an already existing system before I go and overhaul it, and the current setup is that depending on Signature Needed is Yes or No, a bunch of other fields are required on transition... I know there is a ton of stuff wrong that can be improved upon but they want it exactly the same...

 

3 answers

0 votes
Matt Havemann August 2, 2016

No, it's not a copy and paste. I had to type it because copy and paste on this site brings up a "Site Not Found" popup

0 votes
JamieA
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.
August 1, 2016

If Signature Needed is a radio custom field, which I guess it is, you want:

issue.getCustomFieldValue(signatureNeeded)?.value == "Yes"

 

 

0 votes
JamieA
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.
August 1, 2016

Did you copy and paste that or type it? Because there are several mistakes in that code, which should be obvious.

Suggest an answer

Log in or Sign up to answer