Skip to content

Script Rest API has no results #13061

@jiuka

Description

@jiuka

NetBox version

v3.5.4

Python version

3.11

Steps to Reproduce

  1. Save this script into a file called bug.py
from extras.scripts import *


class Bug13061(Script):

    class Meta:
        name = "Demo for Bug13061"
        description = "Demo for Bug13061"

    def run(self, data, commit):
        self.log_success(f"Demo for Bug13061")
  1. Go to https://netbox.example.com/extras/scripts/add/
  2. Upload the bug.py file.
  3. Got to https://netbox.example.com/extras/scripts/bug/Bug13061/
  4. Click on Run Script
  5. Go to https://netbox.example.com/api/extras/scripts/bug.Bug13061/

Expected Behavior

The result should be job result like in the reports endpoint.

Observed Behavior

It is always null.

The job.name is just the name of the script class. When search for the result the script.name
is used and not the class_name therefore no results are found, unless the name ist set to the same value as the class_name.

Metadata

Metadata

Assignees

Labels

severity: 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

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions