I'm using a ScriptRunner Workflow Validator to confirm that two fields are not both null.
I'm using the following:
issue.customfield_10178.value != null || issue.customfield_10284 != null
If I evaluate either side of the expression, I get the result I expect, however when using the "or" I get the following error:
Evaluation failed: "issue.customfield_10178.value" - Unrecognized property of `issue.customfield_10178`: "value" ('value'). Type null does not have any properties
Is there a better way to evaluate that my two fields aren't both null? Both fields are single pickers.
I found my error. I had an erroneous '.value' behind my first custom field.
@Matt Noe The expression
issue.customfield_10178.value != null || issue.customfield_10284 != null
means that both fields need to have values (not empty). How does your expression for the "or" option look like? My main concern here is to make sure that if field#1 is empty then field #2 should not. But if field one is not empty I don't care much about field #2. I'd greatly appreciate your prompt reply.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gregory Kremer The || stands for "or" so it validates that at least one of the two fields are populated (not equal to null), or both can be populated. If both are empty, then the code doesn't proceed.
The evaluation would look something like this:
I'm currently using this to validate on a transition that both fields aren't left blank.
Hope this helps
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.