Conditional Webhook not working as expected #5960

Closed
opened 2025-12-29 19:34:56 +01:00 by adam · 3 comments
Owner

Originally created by @talha700 on GitHub (Jan 18, 2022).

NetBox version

v3.1.5

Python version

3.9

Steps to Reproduce

Webhook is not being generated when using conditional logic.

Here is my webhook config

image

In the Django-rq:
image

My Webhook works fine when there is no conditional logic applied and I get a return status of 200.

Is there something wrong with my conditional ?

Expected Behavior

Webhook should be generated when a device of status 'active' and have a primary IP is updated or if it has a tag of 'networks'

Observed Behavior

No webhook is being generated.

Originally created by @talha700 on GitHub (Jan 18, 2022). ### NetBox version v3.1.5 ### Python version 3.9 ### Steps to Reproduce Webhook is not being generated when using conditional logic. Here is my webhook config ![image](https://user-images.githubusercontent.com/40869474/149912995-455b2a8c-b2c9-491e-823a-8bc618c07451.png) In the Django-rq: ![image](https://user-images.githubusercontent.com/40869474/149913467-7845e726-4aed-4a30-ada5-1ad4f60b2a79.png) My Webhook works fine when there is no conditional logic applied and I get a return status of 200. Is there something wrong with my conditional ? ### Expected Behavior Webhook should be generated when a device of status 'active' and have a primary IP is updated or if it has a tag of 'networks' ### Observed Behavior No webhook is being generated.
adam closed this issue 2025-12-29 19:34:56 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 18, 2022):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@jeremystretch commented on GitHub (Jan 18, 2022): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@jeremystretch commented on GitHub (Jan 18, 2022):

Looking at your condition definition, "status" should be "status.active". This was incorrect in the reference documentation but was just fixed under #8376.

@jeremystretch commented on GitHub (Jan 18, 2022): Looking at your condition definition, `"status"` should be `"status.active"`. This was incorrect in the reference documentation but was just fixed under #8376.
Author
Owner

@talha700 commented on GitHub (Jan 18, 2022):

Thanks for the fix !! status.active works , But when I put conditional for the tags, webhook is not being generated.

{
    "and": [
        {
            "attr": "tags",
            "op": "contains",
            "value": "exempt"
        }
    ]
}

By following the example from the docs i have applied the following conditional and 'exempt' tag is associated with the device.
No webhook is generated on updating the device

@talha700 commented on GitHub (Jan 18, 2022): Thanks for the fix !! `status.active` works , But when I put conditional for the tags, webhook is not being generated. ``` { "and": [ { "attr": "tags", "op": "contains", "value": "exempt" } ] } ``` By following the example from the docs i have applied the following conditional and 'exempt' tag is associated with the device. No webhook is generated on updating the device
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5960