NetBox 2.9 custom scripts missing Script Data form after execution #4093

Closed
opened 2025-12-29 18:33:05 +01:00 by adam · 3 comments
Owner

Originally created by @netsandbox on GitHub (Sep 10, 2020).

Originally assigned to: @lampwins on GitHub.

Environment

  • Python version: 3.6.9
  • NetBox version: 2.9.3

Steps to Reproduce

  1. create a custom script
  2. run the custom script
  3. the Script Data form is now missing

Expected Behavior

Show the Script Data form after script execution.

Observed Behavior

The Script Data form isn't shown after script execution.

In NetBox before 2.9, after running a custom script, the Script Data form was shown under the Script Log, with the previously entered data.
This was especially helpful if you run the script with Commit changes disabled, to validate the changes the script would do, and then run the script with the same data and Commit changes enabled.

Originally created by @netsandbox on GitHub (Sep 10, 2020). Originally assigned to: @lampwins on GitHub. <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report, and that any plugins have been disabled. --> ### Environment * Python version: 3.6.9 * NetBox version: 2.9.3 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce 1. create a custom script 2. run the custom script 3. the **Script Data** form is now missing <!-- What did you expect to happen? --> ### Expected Behavior Show the **Script Data** form after script execution. <!-- What happened instead? --> ### Observed Behavior The **Script Data** form isn't shown after script execution. In NetBox before 2.9, after running a custom script, the **Script Data** form was shown under the **Script Log**, with the previously entered data. This was especially helpful if you run the script with **Commit changes** disabled, to validate the changes the script would do, and then run the script with the same data and **Commit changes** enabled.
adam added the status: acceptedtype: feature labels 2025-12-29 18:33:05 +01:00
adam closed this issue 2025-12-29 18:33:05 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 14, 2020):

Beginning with v2.9, custom scripts are now executed via a background task (see #2006). The redirection in place prevents the original form data from being displayed on the results page. However, you can easily use the browser's back button to return to the original submission view.

@jeremystretch commented on GitHub (Sep 14, 2020): Beginning with v2.9, custom scripts are now executed via a background task (see #2006). The redirection in place prevents the original form data from being displayed on the results page. However, you can easily use the browser's back button to return to the original submission view.
Author
Owner

@lampwins commented on GitHub (Sep 26, 2020):

We could add a simple button that checks to see what the current referrer is and call back(). Soemthing like this works:

function runScript(){
    // Check if the user came from the run script form
    if (document.referrer.includes("/extras/scripts/{{ result.name }}/")) {
        window.history.back();
    } else {
        window.location.href = "/extras/scripts/{{ result.name }}/";
    }
}
@lampwins commented on GitHub (Sep 26, 2020): We could add a simple button that checks to see what the current referrer is and call `back()`. Soemthing like this works: ```javascript function runScript(){ // Check if the user came from the run script form if (document.referrer.includes("/extras/scripts/{{ result.name }}/")) { window.history.back(); } else { window.location.href = "/extras/scripts/{{ result.name }}/"; } } ```
Author
Owner

@netsandbox commented on GitHub (Jan 19, 2021):

As I'm totally fine with using the browser's back button, I'm closing this.

@netsandbox commented on GitHub (Jan 19, 2021): As I'm totally fine with using the browser's back button, I'm closing this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4093