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...
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
If Signature Needed is a radio custom field, which I guess it is, you want:
issue.getCustomFieldValue(signatureNeeded)?.value == "Yes"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you copy and paste that or type it? Because there are several mistakes in that code, which should be obvious.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.