Skip to content

Only one event rule triggers for a content type #14827

@markkuleinio

Description

@markkuleinio

Deployment Type

Self-hosted

NetBox Version

v3.7.0

Python Version

3.11

Steps to Reproduce

Setup:

  1. Create a webhook: Name = Test, URL = http://127.0.0.1:9000
  2. Create event rule 1:
    • Name = Rule 1
    • Content types = Prefix
    • select Updates
    • Condition = { "and": [{"attr": "status.value", "value": "deprecated"}]}
    • Action type = Webhook
    • Webhook = Test
  3. Create event rule 2:
    • Name = Rule 2
    • Content types = Prefix
    • select Updates
    • Condition = { "and": [{"attr": "status.value", "value": "active"}]}
    • Action type = Webhook
    • Webhook = Test
  4. Start webhook receiver (python manage.py webhook_receiver), or observe the webhooks happen in some other way

(Sorry, couldn't figure out the correct condition syntax without using the "and" operator)

Demo:

  1. Create a prefix, like 10.1.2.0/24, status = Active (the defaults)
  2. Edit the prefix: change its status to Deprecated
  3. Edit the prefix again: change its status to Active

Expected Behavior

Webhook is run twice: first when prefix status was changed to Deprecated (step 6), second when changed to Active again (step 7).

Observed Behavior

Webhook is run only once, that's in step 6, but not in step 7.

Additionally: If Rule 1 is disabled, and steps 6 and 7 are executed again, now the webhook is run in step 7.

Looks like only the first enabled event rule is run for a specific object type.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtopic: event rulesFor issues related to the Event Rules featuretype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions