Contents

Useful scheduling scripts

Useful scheduling scripts

Useful scheduling scripts

A business rule script specifies the actions that the business rule takes. Scripts
commonly include predefined global variables to reference items in your system, such as the
current record. Global variables are available to all business rules.

Caution: The customization described here was
developed for use in specific instances, and is not supported by ServiceNow.
This method is provided as-is and should be tested thoroughly before implementation. Post
all questions and comments regarding this customization to our community forum.

Calculate duration given a schedule

Type: Before update/insert business rule

Table: Inicident

Description: A Business Duration calculates the Open to Close duration on an incident based on
the particular Schedules. If there is
no schedule specified, the script will simply use the first schedule returned by the query.

Script example:

The example below sets the resolved duration when the incident state moves to resolved.