Testing a function
This section provides an example of how to test a function.
If using playbooks, create a simple playbook to test the function.
If using rules and workflows, create a rule to trigger the workflow that contains the function. The rule can be a menu-item rule, which displays an action for its object (such as incident, artifact or task) when the conditions are met, or an automatic rule that runs the workflow when an object is created or modified and meets the rule’s pre-defined conditions.
This example uses a menu item rule called Lookup Model with the Type of Artifact, which calls a workflow also called Lookup Model.
The workflow runs on an artifact, so the rule is a menu-item rule that appears as an action in each incident’s artifact action menu, accessible from the […] button.
Select your action to start the workflow and call your function.
The incident’s Action Status menu shows the status of each rule, which can be pending (queued for delivery to the function processor), processed successfully, or with an error. In the following example, the action completed with success and included a status message.