157 views

Description

If both the "Retroactive start" and "Retroactive pause" options are selected on an SLA Definition, a retroactive pause calculation is performed when a Task SLA is created for that definition.

In Kingston, SLA processing performance was improved by carrying out all the retroactive pause calculations for any Task SLAs being attached to a Task in a single pass. (Previously each retroactive Task SLA being created would have been processed individually.)

However, a defect was introduced that affected the "sla" element of the "current" object for the Task SLA being created.  The defect didn't affect the record created in the database but did mean that when dot-walking on the "sla" field it could reference the wrong SLA Definition. This will impact any business rules on the Task SLA record that dot-walk to the SLA Definition record.

Steps to Reproduce

Test these steps on a sub-production instance:

  1. Import the attached "Business rule - output name of SLA.xml" XML file.

    This will create a business rule on the Task SLA table that will output a message whenever a new Task SLA is created that had retroactive pause time calculated. The message will show the value from "current.sla.name" along with the dot-walking to "sla.name" after getting the newly inserted Task SLA record from the database.

  2. Create a new Incident that matches any SLA Definitions.

    For example, on an out-of-the-box instance, create an Incident with Priority 5.

  3. Update the same Incident to match an SLA Definition that is retroactive with retroactive pause enabled.

    For example, on an out-of-the-box instance, update the Incident's Priority to 2.

    An information message will be displayed at the top of the Incident form to show the SLA name from "current" as well as from the Task SLA record that has been stored in the database. The name of the SLA from the database will be correct but the name from "current.sla.name" wiil be incorrect.

 

 

Workaround

Because the Task SLA record in the database is correct, modify any business rules on the Task SLA table that are triggered on insert to fetch the Task SLA record from the database. Then use this copy of the record to do any dot-walking.

For example, if there is a business rule that runs after insert of a Task SLA that checks whether the name of the SLA Definition contains "resolution", if the Condition field contains:

current.sla.name.toLowerCase().indexOf("resolution") >= 0

Remove this line from the Condition field and replace it with the following code in the script field of the business rule:

   (function executeRule(current, previous /*null when async*/) {
      var taskSLAGr = new GlideRecord("task_sla");
      taskSLAGr.get(current.getUniqueValue());

      if (taskSLAGr.sla.name.toLowerCase().indexOf("resolution") < 0)
         return;

      // Followed by script to run for "resolution" SLA Definitions

   })(current, previous);

 


Related Problem: PRB1254494

Seen In

Kingston

Intended Fix Version

London

Fixed In

Kingston Patch 5

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-04-24 00:35:57
Published:2018-04-12