4.0.2 scripts can only be launched by api with ID and no longer with a name. #9679

Closed
opened 2025-12-29 21:20:47 +01:00 by adam · 3 comments
Owner

Originally created by @MalfuncEddie on GitHub (May 15, 2024).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.0.2

Python Version

3.10

Steps to Reproduce

see #16123

In the past I could run the script with "https://netbox-test/api/extras/scripts/scriptA.class"
This does not work anymore and I need an ID ;(

Exception Value: | Field 'id' expected a number but got 'ProcessLogging'.

Expected Behavior

it works lik in 3.7.7

Observed Behavior

ValueError at /api/extras/scripts/ProcessLogging/

launching it with /api/extras/scripts/6/

Does work.

Originally created by @MalfuncEddie on GitHub (May 15, 2024). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.0.2 ### Python Version 3.10 ### Steps to Reproduce see #16123 In the past I could run the script with "https://netbox-test/api/extras/scripts/scriptA.class" This does not work anymore and I need an ID ;( Exception Value: | Field 'id' expected a number but got 'ProcessLogging'. ### Expected Behavior it works lik in 3.7.7 ### Observed Behavior ValueError at /api/extras/scripts/ProcessLogging/ launching it with /api/extras/scripts/6/ Does work.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:20:47 +01:00
adam closed this issue 2025-12-29 21:20:47 +01:00
Author
Owner

@jeffgdotorg commented on GitHub (May 15, 2024):

Thanks for reporting a problem you've encountered in NetBox.

Although the OpenAPI schema does not indicate that scripts can be invoked by name, the 4.0.2 docs do provide an example in that style, so this feels like a regression against a documented behavior.

@jeffgdotorg commented on GitHub (May 15, 2024): Thanks for reporting a problem you've encountered in NetBox. Although the OpenAPI schema does not indicate that scripts can be invoked by name, the [4.0.2 docs](https://github.com/netbox-community/netbox/blob/v4.0.2/docs/customization/custom-scripts.md#via-the-api) do provide an example in that style, so this feels like a regression against a documented behavior.
Author
Owner

@MalfuncEddie commented on GitHub (May 15, 2024):

Hi,

Most definitely a regression. Problem is that you cannot change the id so if you delete the script and add it again it gets a new id and then you have to change all your endpoints that use it.

@MalfuncEddie commented on GitHub (May 15, 2024): Hi, Most definitely a regression. Problem is that you cannot change the id so if you delete the script and add it again it gets a new id and then you have to change all your endpoints that use it.
Author
Owner

@MalfuncEddie commented on GitHub (May 23, 2024):

It works again!
You might not hear this enough but thank you for this fix and this great project!

@MalfuncEddie commented on GitHub (May 23, 2024): It works again! You might not hear this enough but thank you for this fix and this great project!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9679