Input script

The input script can dynamically retrieve a value and then set the input of a function or a sub-playbook to that value.

A function input script can only read incident values. It cannot complete activities such as changing incident values and adding artifacts.

Complete the following procedure to write a script that provides input to a function or a sub-playbook:
  1. Use standard Python language to retrieve values. In the Language field, determine whether to use Python 2 or 3 to evaluate the script.
  2. Provide a value to the function, use the inputs.<field_name> keyword, where field_name is the function field’s API name. If you do not know the field name, type inputs. to have the type-ahead feature display the field names.

    The script ignores any attempt to set the value of anything other than input fields, and it does not issue an error message. It also ignores any attempt to create objects; for example, incident.createTask().

The following example is a simple script that retrieves the ID of the incident and places it into a field called incidentID:

inputs.incidentID = incident.id
You can use the following code to access the output of a function started earlier in the playbook:
playbook.functions.results.<output_name>
You can use the following code to access a property value that was added by a script started earlier in the playbook:
playbook.properties.<propertyName>

For more information, see Playbook operations.