Skip to content

Creating a rule with the default criteria operator fails #897

@winem

Description

@winem

I tried to create a rule that reacts on a specific slack message.

Selection_264

The criteria operator has not been changed and is still the one that's shown per default (regex).

Saving the rule fails with:

{ "faultstring": "For field: trigger.text, operator not in list of allowed operators: ['matchwildcard', 'matchregex', 'regex', 'iregex', 'eq', 'equals', 'neq', 'nequals', 'ieq', 'iequals', 'contains', 'icontains', 'ncontains', 'incontains', 'startswith', 'istartswith', 'endswith', 'iendswith', 'lt', 'lessthan', 'gt', 'greaterthan', 'td_lt', 'timediff_lt', 'td_gt', 'timediff_gt', 'exists', 'nexists', 'inside', 'in', 'ninside', 'nin', 'search']" }

This happens because the preselected operator is not sent to the backend as a look on the request parameters shows:

{
  "pack": "slack",
  "enabled": true,
  "trigger": {
    "type": "slack.message",
    "parameters": {}
  },
  "criteria": {
    "trigger.text": {
      "type": "",
      "pattern": "foo"
    }
  },
  "action": {
    "ref": "core.local",
    "parameters": {
      "cmd": "date -u"
    }
  },
  "name": "slack2",
  "description": "slack"
}

criteria.trigger.text.type should be regex.

It works fine if you select any other operator or any other operator and then regex again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions