Event Rule Condition Issue #11330

Closed
opened 2025-12-29 21:43:44 +01:00 by adam · 5 comments
Owner

Originally created by @VladyslavTkachenkoDesy on GitHub (Jun 30, 2025).

Deployment Type

Self-hosted

NetBox Version

4.3.1

Python Version

3.10

Steps to Reproduce

  1. set up webhook
  2. set up event rule on "Object Update" with condition:
{ 
  "and": [ 
  { 
    "attr": "status.value", 
    "value": "active" 
  }, 
  { 
    "attr": "{{ snapshots['prechange']['status'] }}", 
    "negate": true, 
    "value": "active" 
  } 
  ] 
}
  1. trigger the update

Expected Behavior

Triggered only when the status of object changed from any to 'active'.

Observed Behavior

It was working on my old Netbox, but now I have killed it and recreated new instance and use the same condition but it is triggering every time if the status if 'active'. Seems like "and" does not work or second part of condition wrongly declared.

Originally created by @VladyslavTkachenkoDesy on GitHub (Jun 30, 2025). ### Deployment Type Self-hosted ### NetBox Version 4.3.1 ### Python Version 3.10 ### Steps to Reproduce 1. set up webhook 2. set up event rule on "Object Update" with condition: ``` { "and": [ { "attr": "status.value", "value": "active" }, { "attr": "{{ snapshots['prechange']['status'] }}", "negate": true, "value": "active" } ] } ``` 3. trigger the update ### Expected Behavior Triggered only when the status of object changed from any to 'active'. ### Observed Behavior It was working on my old Netbox, but now I have killed it and recreated new instance and use the same condition but it is triggering every time if the status if 'active'. Seems like "and" does not work or second part of condition wrongly declared.
adam added the type: bugtopic: event rules labels 2025-12-29 21:43:44 +01:00
adam closed this issue 2025-12-29 21:43:44 +01:00
Author
Owner

@ravenrs commented on GitHub (Jul 3, 2025):

@VladyslavTkachenkoDesy Hi, could you please indicate what is the version "my old Netbox"?

@ravenrs commented on GitHub (Jul 3, 2025): @VladyslavTkachenkoDesy Hi, could you please indicate what is the version "my old Netbox"?
Author
Owner

@ravenrs commented on GitHub (Jul 4, 2025):

@arthanson Hi, could you please assign it to me, I need this function on my prod enviroment, because it will drop a lot of unnecessary, I want to combine snapshots and data to impliment this request.

@ravenrs commented on GitHub (Jul 4, 2025): @arthanson Hi, could you please assign it to me, I need this function on my prod enviroment, because it will drop a lot of unnecessary, I want to combine snapshots and data to impliment this request.
Author
Owner

@ravenrs commented on GitHub (Jul 4, 2025):

@VladyslavTkachenkoDesy Hi, I've check in my demo 3.1.7 and I didn't find this functionality, so it's "The Mandela Effect" or it was dropped earlier.

@ravenrs commented on GitHub (Jul 4, 2025): @VladyslavTkachenkoDesy Hi, I've check in my demo 3.1.7 and I didn't find this functionality, so it's "The Mandela Effect" or it was dropped earlier.
Author
Owner

@ravenrs commented on GitHub (Jul 7, 2025):

@arthanson @jeremystretch Hi, I don't think that it is a bug (it's new feature), but I've tried to add functionality to use snaphosts in condition in https://github.com/netbox-community/netbox/issues/18159. If there is no objection I suggest to close this task and assign https://github.com/netbox-community/netbox/issues/18159 to me, I'm ready to create pull request.

@ravenrs commented on GitHub (Jul 7, 2025): @arthanson @jeremystretch Hi, I don't think that it is a bug (it's new feature), but I've tried to add functionality to use snaphosts in condition in https://github.com/netbox-community/netbox/issues/18159. If there is no objection I suggest to close this task and assign https://github.com/netbox-community/netbox/issues/18159 to me, I'm ready to create pull request.
Author
Owner

@jeremystretch commented on GitHub (Jul 10, 2025):

@VladyslavTkachenkoDesy what you're trying to do is not currently supported (and never has been). I suspect you're confusing the template context available within a webhook with the conditional logic for an event rule. Please see FR #18159 as referenced above.

@jeremystretch commented on GitHub (Jul 10, 2025): @VladyslavTkachenkoDesy what you're trying to do is not currently supported (and never has been). I suspect you're confusing the template context available within a webhook with the conditional logic for an event rule. Please see FR #18159 as referenced above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11330