Skip to content

Rule criteria doesn't work with custom header #4995

@makandre

Description

@makandre

SUMMARY

The doc states:

If the criteria key contains any special characters (like -) then use the dictionary lookup format for specifying the criteria key. In case of a webhook based rule it is typical for the header of the posted event to contain such values:

criteria:
trigger.headers['X-Custom-Header']:
type: "eq"
pattern : "customvalue"

So I was trying a rule to receive a simple GitHub issues webhook, with the criteria defined like so:

image

But the rule is not run.

I know I have defined the webhook correctly, because if I changed the criteria to something else, like trigger.body.action eq opened, it works.

STACKSTORM VERSION

Paste the output of st2 --version:
st2 3.3dev (201c05882), on Python 3.6.9

OS, environment, install method

Post what OS you are running this on, along with any other relevant information/

  • e.g. Docker, Vagrant, Kubernetes, etc. Describe how you installed ST2
  • e.g. one-line install, custom install, etc -->

Installed on Kubernetes cluster using Helm

Steps to reproduce the problem

Show how to reproduce the problem, using a minimal test-case. Make sure to include any content
(pack content - workflows, actions, etc.) which are needed to reproduce the problem.

  • I have GitHub pack installed
  • create a rule:
    • webhook trigger w/ url = github
    • criteria (as above)
    • action set to github.add_comment

Expected Results

What did you expect to happen when running the steps above?

Rule runs the action upon receiving an issues webhook from GitHub

Actual Results

What happened? What output did you get?

Nothing runs

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions