I'd like to setup a validator to prevent a transition from happening in our workflow if certain criteria aren't met. I know this can be achieved through validators/conditions in the transitions. But the criteria I want is a bit more complicated and would involve and/or logic.
For example, I only want to allow a ticket to be transitioned to Code Review status if the Peer Reviewers field is not empty, or if the Skip Peer Review checkbox is not empty. If either of the criteria are met I would like the transition to be allowed. I know I can set up a validator for each one of those fields, but that means that I would need both fields to be not empty, which isn't what I want. What I really want is the or logic so that if either one of those fields is set then the transition is allowed. Is there a way to do more complex validation like this?
Hello @mburke
I see two possible solutions to your problem. The first would be to have a look at the setting for the condition. At the top left corner of the condition view, you can choose wether or not to require all the conditions or any of them. This could solve the need you have.
Another thing you can have a look at is Jira Misc Workflow Extensions, which is a plugin that give you more to work with. This includes the possibility to script the conditions with Groovy code. See this link: https://marketplace.atlassian.com/apps/292/jira-misc-workflow-extensions-jmwe?hosting=cloud&tab=overview
Hope this helps!
Good luck with your Jira endeavors!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.