Skip to content

Job results are not available when executing custom scripts via the runscript command  #14549

@erikastr

Description

@erikastr

Deployment Type

Self-hosted

NetBox Version

v3.6.6

Python Version

3.11

Steps to Reproduce

  1. Create/upload any custom script (e.g. the example script from documentation)
  2. Try to execute the script via runscript command
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py runscript example.NewBranchScript --commit --loglevel debug --data '{"site_name": "testing", "switch_count": 1, "switch_model": 11}'

Expected Behavior

Script is completed and job results are available

Observed Behavior

Script gets completed, but a KeyError exception gets raised when trying to access the job results
image

It seems that an incorrect name tries to get accessed when the script is ran through the runscript command, as compared to running the script via the GUI

image

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: 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