Rule not working with error {rule.trigger "core.st2.webhook" and trigger.ref "core.59362943-d192-4502-bc0a-9c7c8ecc69d1" do not match.}

Hi Team,

I created a rule:

---
    name: "pdalert_remediation_rule"
    pack: "default"
    description: "PD alert remediation rule"
    enabled: true

    trigger:
        type: "core.st2.webhook"
        parameters:
            url: "sample"

    criteria:
        trigger.body.messages[0].event:
            pattern: "incident.trigger"
            type: "equals"

    action:
        ref: "default.pdalert_remediation"
        parameters:
            hostname: "{{trigger.body.messages[0].log_entries[0].channel.host}}.srvs.ahdev.co"
            event_id: "{{trigger.body.messages[0].log_entries[0].agent.id}}"
            email_id: "prabhanshu.pandey@acquia.com"

While executing the rule trigger is getting processed but no execution ID is getting created.

While looking into it further and testing the rule i see.

[05:28:36] root@ded-95.opsteam1:/opt/stackstorm/packs/default/rules# st2-rule-tester --trigger-instance-id=60e6467244c92e3371291b06 --rule=pdalert_remediation_rule.yaml --debug
2021-07-08 05:28:44,218 INFO [-] Connecting to database "st2" @ "127.0.0.1:27017" as user "stackstorm".
2021-07-08 05:28:44,279 INFO [-] Successfully connected to database "st2" @ "127.0.0.1:27017" as user "stackstorm".
2021-07-08 05:28:44,279 DEBUG [-] Ensuring database indexes...
2021-07-08 05:28:45,333 DEBUG [-] Skipping index cleanup for blacklisted model "PermissionGrantDB"...
2021-07-08 05:28:45,721 DEBUG [-] Indexes are ensured for models: ActionAliasDB, ActionAliasDB, ActionDB, ActionExecutionDB, ActionExecutionDB, ActionExecutionOutputDB, ActionExecutionSchedulingQueueItemDB, ActionExecutionStateDB, ActionExecutionStateDB, ApiKeyDB, ConfigDB, ConfigSchemaDB, GroupToRoleMappingDB, KeyValuePairDB, LiveActionDB, LiveActionDB, PackDB, PermissionGrantDB, PolicyDB, PolicyTypeDB, RoleDB, RuleDB, RuleEnforcementDB, RunnerTypeDB, RunnerTypeDB, SensorTypeDB, TaskExecutionDB, TokenDB, TraceDB, TriggerDB, TriggerInstanceDB, TriggerTypeDB, UserDB, UserRoleAssignmentDB, WorkflowExecutionDB
2021-07-08 05:28:45,804 INFO [-] rule.trigger "core.st2.webhook" and trigger.ref "core.59362943-d192-4502-bc0a-9c7c8ecc69d1" do not match.
2021-07-08 05:28:45,821 INFO [-] === RULE DOES NOT MATCH ===

Can someone look into it? I so want to move forward from the below error.

2021-07-08 05:28:45,804 INFO [-] rule.trigger "core.st2.webhook" and trigger.ref "core.59362943-d192-4502-bc0a-9c7c8ecc69d1" do not match.

Regards,
Prabhanshu.

Impossible to tell why it is not matching without the original trigger data that is being received by ST2 in the webhook, but it appears that the criteria you have set in the rule in not matching what is being received.

    criteria:
        trigger.body.messages[0].event:
            pattern: "incident.trigger"
            type: "equals"

You should be able to test this by sending in some mock data to your “sample” URL to see if you can get it to match.
If you can post the trigger data or the original HTML body data sent to the webhook that may help identify the matching failure.