Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,198
Community Members
 
Community Events
184
Community Groups

Stepped validator against two variables

I have a validator check setup that always returns TRUE when using the OR (||) option.  Is there a way to logically validate the reporter accountId first and then proceed to the sub-task check if it evaluates to false?

This is what I have 

issue.reporter.accountId != '<number_Id>' || issue.issueType.name != 'Sub-task' 

Ideally, I'd like to first check the accountID if it is True then validate. If it is False, then proceed to the issueType validation.

Hope I am making sense.

Thanks in advance

2 answers

0 votes
David Fischer _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2023

Hi @Bill Goetz 

Which Validator type are you using, i.e. where are you using this script? Also, what is exactly the condition under which validation should succeed?

Field required validator in a workflow. We want to make sure an Epic link is entered when creating a ticket.

Exceptions:

If a the issue is a sub-task, allow it to be skipped.

OR

If the reporter is a specific account ID (for a service account) allow it to be skipped.

 

2023-05-26_09-58-15.png

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2023

It depends on the language and the interpreter. Most interpreters would process it starting with the leftmost expression, and if that evaluates to true, then wouldn't care about other expressions at all.

Are you 100% sure that in this case it works differently?

(You could either ask the app's developer or maybe add a print("left") kind of statement to the left expression and an print("right") to the right one and check the output whether you  see "right" printed when the left one evaluates to true.)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events