Testing scripts

When you have written a script, you can test your script against an existing object. For example, if the script’s object type is Milestone, you run the script against a milestone within an incident.

When you test a script, you are prompted to enter a valid ID. For the email message object type, you are prompted for an email message ID. You can find the ID on the Mail Inbox page, which you can access by clicking Inbox in the menu. For any other object type, you must enter a valid incident ID. You can find the ID by opening an individual incident or scenario. The ID is in the Summary section of the page.

Important: A script can result in changes to the data. When testing your script and you are not in a development environment, you should use a simulated incident ID to run your script against simulations and not open incidents. For email messages, you should create a test email, which you can do by sending an email to the account configured in the inbound mailbox, which is described in Configuring an inbound email connection.

To test your script:

  1. Click the Run button.
  2. When prompted for an incident, enter a valid ID.
  3. Select an object within the incident. Only those objects of the type assigned to the script are shown.
  4. Click Finish.

The script runs and a console window displays with the results. It is slightly transparent so that underlying content can be visible.

If you want to view information at specific points in the script, make sure to include in the script the log info method described in the previous table. For example:

log.info("The value of x is {}".format(x))

Log messages are the last set of information reported after each run. You can filter the log messages by changing the Log Level choice in the Console Window header area.

Because the system is designed to execute concise scripts, “stepping-through” the code is not available.

If you make changes and wish to rerun the script using the same incident and object, click Run Again. You do not need to save the script to run the script again.

Note: It is important to test your scripts fully to verify that the results are as expected. The Orchestration & Automation application cannot fully verify script logic.