This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

Ncontain rule criteria

Im trying to figure out how to use a list with the ncontains criteria operator or multiple criteria against the same element. I have a rule that is setup to check trigger.body.event.type ncontain this. This is working fine by itself. If trigger.body.event.type conains anything else it triggers the rule. Now I want to expand this to be if trigger.body.event.type ncontain this and trigger.body.event.type ncontain that, so that if the trigger.body.event.type contains anything other than this or that, it will trigger the rule.

When trying to add multiple criteria against a single element on the ui, it collapses down into a single line item. I have created a yaml to try and do it.

criteria:
trigger.body.event.type:
pattern: [ “this”, “that” ]
type: “ncontains”

and I have tried

criteria:
trigger.body.event.type:
pattern: “this”
type: “ncontains”
trigger.body.event.type:
pattern: “that”
type: “ncontains”

I know I can switch it up to do regex and create a massive list of all the options I want to go into the rule, but the list of options that don’t need to match the rule is way smaller. Any ideas?

Thanks

Ok I figured out how to do this with the help and direction of James.reid on the slack community.

Using regex the expression is

^(?!(this|that)$).*$

This will match anything except this or that and the rule will fire.

Thanks