Does InvalidInputException not work for verison 6.2.1?

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

This widget could not be displayed.

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

This widget could not be displayed.

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

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

 

 

This widget could not be displayed.

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

37 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you