When to use conditions vs validators

Alexander Ling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2019

Hello!

I have a question about conditions and validators when transitioning issues. I understand the differences between a condition and validators. I also know the different options that exists for conditions but doesn't for validators. 

The one thing they have in common though is the "Permission condition/validator" and I'm not sure why I would ever use a validator instead of a condition.

So my questions are:

  • Why would I use a validator instead of a condition?
  • Why would a user want to see an option that they cannot do? (any good examples of situations when it's useful)

Thanks in advance for the help!

6 answers

7 votes
Andrew Laden
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2019

Conditions are evaluated every time the issue is displayed. It checks to see if it can even present the option to make the transition to the user. As such, you want your conditions to be things that can be checked easily, quickly and with low CPU impact.

Validators are only checked when the transition is executed. In particular, if you use a transition screen, you have the opportunity to make changes to the issue to allow it to pass the validator even if it didn't when you selected the transition. You can also make more complicated validators (using scripting for example) that would otherwise be too CPU intensive. Finally, a validator can pop up an error message to the user when it does not pass, whereas a condition just does not present the option.

2 votes
Lady Di
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 15, 2019

Additional features appear along with an additional app. You can look towards free:

Toolkit Plugin for Jira

set of predefined functions

MyGroovy

A tool for writing your own functions in the Groovy language

or paid:

AM Utils

Admin Toolbox for Jira

set of predefined functions

2 votes
Lady Di
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 15, 2019

If we are talking about permission validators/conditions, you are right, they are interchangeable.
But validators can be used in a variety of cases:
- Checks for resolutions of related tasks
- Checking data in task fields (required fields)
- Plugin validators, for example, that all checklist items have been completed, or that all approvers have agreed on the task.

A lot of options.

0 votes
Alexander Ling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2019

Thanks for your answer!

0 votes
Alexander Ling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2019

Thanks again, now I understand why to use validators more clearly :-)

0 votes
Alexander Ling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 15, 2019

Thanks for the answer!

When I try to set a validator on one of my transitions, I get these two options:

image.png

Where can I set the other options you are talking about?

Suggest an answer

Log in or Sign up to answer