Macro conditions

Macro conditions are expressions written in Service Management Rapid Application Development (RAD) syntax that evaluate at run time. If the expression evaluates to true, the macro executes. If the expression does not evaluate to true, the macro cannot proceed.

A macro’s condition can be very simple. For example, true or tod()< = ‘17:00:00’>. Macro conditions often include a check against the record being saved. For example, a macro condition can be expressed for an action or group of actions when a specific set of incident records is saved.

The record currently being saved is identified to macro conditions as $L.new. This variable can be used as $file in Format Control expressions. Macro expressions also have $L.old available. This represents the state of the record before it was altered. All the following expressions are valid:

  • priority.code in $L.new=“1”
    Executes whenever a priority 1 record is saved.
  • assignment in $L.new~=assignment in $L.old
    Executes whenever the assignment group changes.
  • tod() <= ‘17:00:00’
    Executes whenever a record is saved before 5:00 PM.

The variable $L.message can create evaluating expressions that gather certain information about incident records. This data is then sent as a message to specific users or groups defined in the Macro Parameters form. The $L.message is expressed as an array, using the following syntax:

$L.message={"Incident#" +number in $L.new, brief.description in $L.new}

The result is an array of the Incident ID and Incident Title in the record being saved ($L.new). The message might look like this:

Incident # IM1012
Phone is going dead intermittently.