Reactivate SLAs on Employee Comment

From SDU
Jump to: navigation, search
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This article provides instructions for reactivating the SLAs when an Employee adds a comment to a Request, Incident, or Problem. This assumes that the current Status suspends the SLAs and that when the End User adds a comment that the Status will be set to one that will start the SLA clocks ticketing once again.

Procedures

Step 1. Create the scripts

A script is created as an .spl file and placed in the $NX_ROOT/site/mods/majic directory. When the Service Desk service starts, the contents of the majic directory are processed and cached. You can use any naming scheme you like for your .spl file, but it is recommended that the file be preceded with a 'z' for easy identification as a custom file (eg zMyCompany.spl, zcr_scripts.spl, zMyScripts.spl).

This script is triggered on the Act_Log table and writes the new status to the status field in the Call_Req table. The script assumes that the Employee Access Type is associated with the Employee Interface and that it is also set as the default Access Type. <source lang="javascript">alg::myscript(...) { string new_stat; // Enter the desired status code below

	new_stat = 'OP';

if (analyst.access_type == 2405 || is_null(analyst.access_type)) { send_wait(0, this, "call_attr", "call_req_id.status", "set_val", new_stat, "SURE_SET"); if (msg_error()) { logf(ERROR, "error setting status to %s on %s %s - %s", new_stat, call_req_id.type.sym, call_req_id.ref_num, msg[0]); return; } else { logf(SIGNIFICANT, "successfully set status to %s on %s %s", new_stat, call_req_id.type.sym, call_req_id.ref_num); } } }</source>

Step 2. Create the trigger

This step is to create the trigger that will initiate the script. The methods used to implement the trigger vary based on the Service Desk release.

For r11.x releases triggers are created via the Schema Designer utility. Add the following code as a Site-Defined Trigger to the alg (Request Activity Log) table. <source lang="javascript">POST_VALIDATE zmyscript() 113 FILTER(type{-> 'LOG'});</source>

For older releases triggers are made by creating a .mod file and placing it in the $NX_ROOT/site/mods/majic directory. Name the .mod anything you like, but it is recommended that it be preceded with a 'z'. <source lang="javascript">alg {

 TRIGGERS {
   POST_VALIDATE zmyscript() 113 FILTER(type{-> 'LOG'});
 };

};</source>

Step 3. Publish the Schema changes

The methods used to publish schema changes vary based on the Service Desk release.

For r11.x releases, follow these steps:

  1. Save your Schema changes
  2. Stop the Service Desk service
  3. Run pdm_publish from a command line (Applicable if you made changes via WSP)
  4. Start the Service Desk service

For older releases recycle the Service Desk service.