Howto: Write rule to trigger action that takes an array parameter

triggers
rules
howto

(Lindsay Hill) #1

If you are writing a rule that runs an action that takes an array parameter, you need to use JSON-style notation for your array.

So your rule should look something like this:

---
name: "myrule"
pack: "default"
description: "example rule to trigger action taking an array"
enabled: true
trigger:
  type: "my.trigger"
criteria:
  trigger.body:
    type: "iequals"
    pattern: "testing"
action:
  ref: "default.myaction"
  parameters:
    ArrayParameter: ["foo", "bar"]

(Eugen C.) #2