Writing scripts

You can access objects when writing a script. These objects reflect the action object data and some contain helper methods. Note that the script feature can access all the objects available as Object Types, as well as additional objects.

When writing a script, type the object, such as "incident." or "task.", to display the available field values. To see the custom fields, type "incident.properties.".

You can write a script from the Scripts tab or from the Playbook designer. If creating a script from a playbook, you can choose to have that script available to the playbook only and is not listed in the Scripts tab.

Perform the following:

  1. If in the Scripts tab, click the New Script button. If in a playbook, click the script icon in the library then click Create script.
  2. If you clicked Create script from the Playbook designer, choose the Script scope, which is Global to have this script available to all playbooks and from the Scripts tab, or Local to have this script available to the playbook only.
  3. Enter a descriptive name for the script.
  4. Provide a description of the script's purpose.
  5. Select an object type. If selecting Data Table, you must also select the specific data table.
  6. Choose a language. Python 3 is the default, but you might want to write a script in Python 2 for backwards compatibility. For more information, see Python 2 and Python 3 differences.
  7. Review the following sections, which describe the objects accessible by the script and the operations that can be utilized.

For local scripts created with Playbook designer, also see Playbook operations for operations unique to the playbook script.