Skip to content

Enable the use of request data in event rules conditions #19043

Closed as not planned
Closed as not planned
@rodvand

Description

@rodvand

NetBox version

v4.2.6

Feature type

New functionality

Proposed functionality

Allow users to make use of request data (such as username) when deciding to trigger an event rule.

Use case

Some integrations are shared between systems, so NetBox may update a system using a webhook, and then the same system may update another field in NetBox. So when the second system updates a field in NetBox I want to avoid running a webhook updating the other system again. Basically to avoid a never-ending loop of updates.

As an example I would like to do something like this in an event rule:

"attr": "username",
"negate": true,
"value": "api_othersystem"

If I am to look beyond my own specific need, I can see the need of using the group membership of the user triggering the event as well. Maybe there are multiple systems updating certain fields in NetBox, and you want to group them to make is easier to decide on event rules triggering.

Database changes

No database changes. From what I can see the need is to add some request data (for an example username) to the data dictionary used in this line:

if not event_rule.eval_conditions(data):

External dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: mediumRequires a substantial but not unusual amount of effort to implementtopic: event rulesFor issues related to the Event Rules featuretype: featureIntroduction of new functionality to the application

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions