Skip to content

ObjectChanges not created when running Script from EventRule #20743

@matejv

Description

@matejv

NetBox Edition

NetBox Community

NetBox Version

v4.4.5

Python Version

3.12

Steps to Reproduce

  1. Create & upload a custom script with the following content:
from extras.scripts import Script
from tenancy.models import Tenant


class TestSnapshots(Script):
    def run(self, data: dict, commit: bool) -> str:
        tenant = Tenant.objects.get(name="tenant a")
        tenant.snapshot()
        tenant.description = "updated from event rule"
        tenant.full_clean()
        tenant.save()
  1. Create Tenant with name tenant a. Leave description empty.
  2. Create EventRule that will run script. Exact values don't matter, for example:
    • object types: Contact group
    • event types: Create
    • action type: Script
    • script: script uploaded above
  3. Create Tenant group with any values
  4. Check Changelog for Tenant tenant a.

Expected Behavior

An update changelog entry for tenant a is created that indicates change of tenant description.

Observed Behavior

No changelog entry is created.

Metadata

Metadata

Assignees

Labels

netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions