Pre-process script

You use a pre-process script to dynamically retrieve a value then set a function’s input to that value. A pre-process script can only read incident values. It cannot perform activities such as changing incident values and adding artifacts.

Use standard Python language to retrieve values. In the Language field, determine whether to use Python 2 or 3 to evaluate the script.

The scope and restrictions that apply to the scripting feature, as described in Configure Scripts, applies here too.

To 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 the inputs. keyword and the type-ahead displays the field names.

The pre-process 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 simple example of a pre-process script retrieves the ID of the incident and places it into a function field called incidentID.

inputs.incidentID = incident.id

You also use workflow.properties to access a property saved earlier by a post-process script of a different function or a regular script in the same workflow. You need to know the name assigned to the property by the script.