Several conditions in Condition part of Watcher

Hey community,

Can you advise please: is it possible or what is the correct way to mention in Condition part of watcher several conditions (sorry for tautology).

I want to use smth like this:

"condition": {
"script": {
"source": "if (ctx.payload.aggregations.check.buckets.third.uniq.value == 1 || ctx.payload.aggregations.check.buckets.first.uniq.value == 1 || ctx.payload.aggregations.check.buckets.second.uniq.value == 1 || ctx.payload.aggregations.check.buckets.fourth.uniq.value == 1) return true; return false;",
"lang": "painless" }}

This not work. Only works if I use one OR (||):

("if (ctx.payload.aggregations.check.buckets.third.uniq.value == 1 || ctx.payload.aggregations.check.buckets.first.uniq.value == 1)

So I want to notify me if some of checks is equal 1.

Hey, Sorry for my fault.

All is work when I use several || in condition.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.