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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.)
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.