Unable to trigger a webhook via script execution #8893

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

Originally created by @jeremystretch on GitHub (Nov 29, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.6.5

Python version

3.10

Steps to Reproduce

  1. Upload a simple script that executes cleanly. (It doesn't have to do anything.)
  2. Create a webhook.
    • Content types: Extras > Script
    • Events: Job executions, job terminations
    • URL: Where you have a receiver running (can use the webhook_receiver management command locally)
  3. Ensure the RQ worker process is running.
  4. Run the script you uploaded and verify that it completes successfully.

Expected Behavior

Two webhooks should be sent: One when the script starts, and another when it ends.

Observed Behavior

The webhook is not triggered for either event. This is because the content type with which the webhook is associated (extras.Script) differs from the job's object type (extras.ScriptModule). This can be confirmed by inspecting the completed job under operations > jobs.

Originally created by @jeremystretch on GitHub (Nov 29, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.6.5 ### Python version 3.10 ### Steps to Reproduce 1. Upload a simple script that executes cleanly. (It doesn't have to do anything.) 2. Create a webhook. * Content types: Extras > Script * Events: Job executions, job terminations * URL: Where you have a receiver running (can use the `webhook_receiver` management command locally) 3. Ensure the RQ worker process is running. 4. Run the script you uploaded and verify that it completes successfully. ### Expected Behavior Two webhooks should be sent: One when the script starts, and another when it ends. ### Observed Behavior The webhook is not triggered for either event. This is because the content type with which the webhook is associated (`extras.Script`) differs from the job's object type (`extras.ScriptModule`). This can be confirmed by inspecting the completed job under operations > jobs.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:42:35 +01:00
adam closed this issue 2025-12-29 20:42:35 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 5, 2023):

Blocked by #14438

@jeremystretch commented on GitHub (Dec 5, 2023): Blocked by #14438
Author
Owner

@jeremystretch commented on GitHub (Feb 23, 2024):

Unblocking this as #14438 has been completed for the upcoming v4.0 release.

@jeremystretch commented on GitHub (Feb 23, 2024): Unblocking this as #14438 has been completed for the upcoming v4.0 release.
Author
Owner

@arthanson commented on GitHub (Feb 28, 2024):

This is fixed in NB 4.0 due to the changes in #14438 so closing. Tested in NB 4, webhooks are successfully sent.

@arthanson commented on GitHub (Feb 28, 2024): This is fixed in NB 4.0 due to the changes in #14438 so closing. Tested in NB 4, webhooks are successfully sent.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8893