I have a transition in a workflow and want to make sure that at least one of a group of number fields is populated. I tried this:
issue.customfield_11667 != null || issue.customfield_11668 != null || issue.customfield_11669 != null || issue.customfield_11670 != null || issue.customfield_11671 != null || issue.customfield_11672 != null || issue.customfield_11673 != null || issue.customfield_11674 != null || issue.customfield_11679 != null || issue.customfield_11680 != null || issue.customfield_11681 != null || issue.customfield_11682 != null || issue.customfield_11683 != null || issue.customfield_11675 != null
But it said that there was a limit of 10 expressions and errored
Then I tried this:
(issue.customfield_11667|0 + issue.customfield_11668|0 + issue.customfield_11669|0 + issue.customfield_11670|0 + issue.customfield_11671|0 + issue.customfield_11672|0 + issue.customfield_11673|0 + issue.customfield_11674|0 + issue.customfield_11679|0 + issue.customfield_11680|0 + issue.customfield_11681|0 + issue.customfield_11682|0 + issue.customfield_11683|0 + issue.customfield_11675) > 0
And it said "Evaluation failed: "issue.customfield_11667 + issue.customfield_11668" - operator "+" is not applicable to types: null and null"
Then I tried this, thinking it might work like with smart values:
(issue.customfield_11667|0 + issue.customfield_11668|0 + issue.customfield_11669|0 + issue.customfield_11670|0 + issue.customfield_11671|0 + issue.customfield_11672|0 + issue.customfield_11673|0 + issue.customfield_11674|0 + issue.customfield_11679|0 + issue.customfield_11680|0 + issue.customfield_11681|0 + issue.customfield_11682|0 + issue.customfield_11683|0 + issue.customfield_11675) > 0
And that errored ... is there a better/correct syntax for that?
And obviously checking for nulls for each field would have me hitting the 10 expression limit again.
And I can't break it up into two separate validators because you can't "or" validators
How can I either check to make sure at least one of these 13 fields has a value or add the values of this many fields that may be null?
Dear @Cash Coyne ,
One way to work around this limitation is to use a scripted validator with a custom scripted validator script that checks for the condition you want.
Here's an example script that you can use:
import com.atlassian.jira.component.ComponentAccessor
I get this error:
Jira expression failed to parse: line 1, column 1: expression expected, reserved keyword 'import' encountered.
Is that because I'm on Jira Cloud?
Under the code window, it says "Script Validators ONLY use Jira Expressions"
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.