I would like to write a script validator. It should summarize some number from a database, and if the sum is big enough the user can go into the new issue status, otherwise it should give back an error msg.
I wrote the code and it do the summerizig, and the if well, but i couldnt find anything about what i should give back to the validator.
Its JIRA v6.2.3.
Thanks for help,
Dani!
Hello @MrDanielKing
The validator only gives back error in case the validation failed scenario occurs otherwise it doesn't do anything.
Please see sample here
In case you want to throw error and stop the transition then throw the following exception with a custom msg
throw new InvalidInputException("fixVersions", "Fix Version/s is required when specifying Resolution of 'Fixed'")
Thank you @Tarun Sapra but i have not acces for the scriptrunner, so i think i cannot use the InvalidInputException.
However you say, if the result is good, so the issue status is changeable, i dont have to give anything back to the groovy?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If everything is good then no need to return anything,, only throw exception if an condition test fails like the sample in the link which I shared.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.