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

0 votes

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

0 votes

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

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



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 Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

819 views 5 17
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot