Documentation/Scripts/Editing Scripts
From ScriptRunner
Documentation :: Scripts:: Editing Scripts
Warning: Editing a script could result in any scheduled instances of that job to become disabled. This will occur if any script arguments are updated, and is to ensure arguments are reviewed before schedules are allowed to continue.
Editing a Script
- From the menu, select Manage Scripts.
- The Edit Script window should now be shown.

- Name: A descriptive name to give your script to reference it in other areas of ScriptRunner.
- Description: A further description of your script, shown to users when selecting scripts to run.
- Group: When scripts are displayed in ScriptRunner they are often grouped together. This selects the group the script resides within.
- Host: Select the host the script should run on. See Script Hosts for more information.
- Script Location: The full path of the script or application you wish to execute.
- Maximum Return Code: The highest return code allowed to be returned by the script for it to accepted as successfully running. A return code higher than this value will mark the running of the script as 'ERROR' on completion, and trigger notifications of a failure if scheduled.
- Timeout: The amount of time a script can be executing for until a notification is raised to say it has been running too long.
- Enabled: Keep this box checked to ensure the script is visible to users. Disabled scripts will not show on the Run Scripts screen, or in any script selection boxes such as when managing scheduled scripts.
- Reference Required: Indicates if any user running this script should provide a incident or change record to reference against.
- Log Retention Days: How many days to store the output of the script in the database.
- Scripts can take any number of arguments required. It's important that you provide them in the order your script or application is expecting. Arguments will be passed to your script in the order shown in the Script Arguments section of the Create Script window, from top to bottom.
To add a script argument, click File:AddNewArgument.png. This will create a new argument at the bottom of the list of arguments. To remove an argument click
next to the argument you wish to remove. Any change to the arguments will disable any scheduled occurrences of the script once saved.
- Number: Indicates the order in which the arguments will be passed to your script or application.
- Name: A name to describe what this argument is. This name is displayed to users running scripts.
- Description: A further description to what the argument is for. This field is provided more space on the Run Script screen and is shown to users when running scripts too.
- Prefix: If the argument requires a static prefix before providing the the users input, the this can be provided here. This will technically be passed as another argument to your script or application, and always be position prior to what the user running your script inputs. For example, if your script or application needs an argument such as
--userId 1, then this field should be used to provide the--userIdpart of that argument. - Default Value: This provides an option to present a default value to users when they run the script, and can chose to overwrite the value if required. This value is also used when the fixed option is selected.
- Type: Select the most appropriate input type for this argument to ensure that only valid arguments can be input by a user running the script. See Script Argument Types for managing this list.
- Fixed: Tick this option if the argument should not be able to be changed by the user when running the script. A value for the argument must be provided in the Default Value field if this is ticked.
- Select the user groups you want to grant access to running the script by ticking the box next to the user group names you wish to grant access. See Managing User Groups for managing user groups.
- Click
. Any issues with the information provided that prevent the script from being saved will be highlighted in red.
- The updates will now be saved and shown for any users now running the script. If any of the arguments were changed in any way, then any scheduled occurrences of the script will now be disabled in case the change affected how they need to run.
For creating new scripts, see Adding Scripts .