Configure scripts for playbooks
You can write and edit scripts that customize incidents and retrieve information on incidents and other object types. You can then start a script from a playbook, rule, or workflow.
You must be familiar with writing scripts in Python.
Use the Scripts tab to view, edit, and create scripts. The tab provides
the following information.
- Script Name. Click the name of a script to view its details or edit the script. When you edit or create a script, enter a name that is descriptive of the script’s purpose to assist users who use the script.
- Script Language. The language used to evaluate all script conditions. You can run scripts that use Python 2 and Python 3, but you must use Python 3 to create or edit scripts.
- Description. Enter text to describe the script.
- Object Type. You assign a script to one type of object, such as incident, note, milestone, task, attachment, artifact, data table, or email message. The object type determines the context of the data that is provided to the script.
- Rules. A list of rules that call the script. Any disabled rules are shown in red.
- Trash can icon. Click to delete the script. If a script is referenced in a rule, you must remove it from the rule before you can delete it.
You can also write scripts from the Playbook designer. When you write a script from a playbook, you can choose to make the script local to that playbook only, and access outputs from functions within the playbook.