Typically, the workflow for a Task SLA record (including the base system Default SLA workflow) is used to generate events when the Task SLA reaches certain points in the allowed time before the SLA breaches (for example, when it reaches 50% and 75% of the duration before it breaches).

These timers in the workflow:
- are triggered without any update occurring to the Task SLA record itself
- create an event
- will not "refresh" the timings in the Task SLA

If the event generated by the workflow is then used to trigger some other activity (for example, sending an email) and that activity includes data from the Task SLA, such as the actual elapsed percentage, this data could be out of date.

Steps to Reproduce


Log in as admin and perform the following steps.

  1. To easily reproduce the issue, the scheduled jobs that refresh the timings in active Task SLA records need to be disabled.
    1. In the navigator filter, type sys_trigger.list to open the list of Schedule records.
    2. Filter the list to any records with a Name that starts with SLA update. (There should be 6 records.)
    3. Update these records to have a state of Error to prevent them from being picked up by the workers.
  2. Similarly, we need to ensure that the Task SLAs are not refreshed when a task form is loaded.
    1. In the navigator filter, type sys_properties.list to open the list of System Properties.
    2. Filter for property name equals glide.sla.calculate_on_display.
    3. Ensure that the value of this property is false.
  3. Add the field Actual elapsed percentage to the body of the email notification SLA warning.
    1. In the navigator filter, type sysevent_email_action.list to open the list of Email Notifications.
    2. Filter on name equals SLA warning.
    3. In the Message field, on a new line, add the text Actual elapsed percentage: ${percentage}.
  4. Create an SLA Definition with a duration of just 2 minutes that matches with any incident.
    1. In the navigator filter, type contract_sla.list to open the list of SLA Definitions.
    2. Click New and enter the following values on the form:
      • Name: SLA notification test
      • Duration: 2 minutes
      • Start condition: Active is true
      • Stop condition: Active is false
    3. Click Submit.
  5. Turn on email notifications for user Beth Anglin.
    1. In the navigator filter, type sys_user.list to open the list of Users
    2. Filter the list for Name equals Beth Anglin.
    3. Open this record.
    4. Ensure that the Notification field is set to Enable.
    5. Save the record.
  6. Create an incident that matches the SLA definition you just created and that is assigned to user Beth Anglin.
    1. In the navigator filter, type incident.do to open the create new Incident form.
    2. Enter the following values on the form:
      • Caller: Abel Tuter
      • Short description: SLA notification test
      • Assigned to: Beth Anglin
    3. Click Submit.
  7. Wait for 2 minutes and then check the email Outbox for SLA warning... emails created today. The first 2 should have an elapsed percentage of 0 in the body of the message.
    1. In the navigator filter, type sys_email.list to open the list of emails.
    2. Filter the list to Records equals Created on Today and Subject starts with SLA warning.
    3. Sort the list in ascending Created order.
    4. Open either of the first 2 records in the list.
    5. Click Preview HTML body.
    6. The pop-up form contains Actual elapsed percentage: 0.



This workaround can be removed after an instance has been upgraded to a version containing the fix (see the Fixed In field below) because the SLA Percentage Timer activity definition will be updated to ensure the Task SLA timings are refreshed when the timer expires.

  1. Set the glide.sla.calculate_on_display system property to true.
  2. Modify, as described below, the workflow used for Task SLAs to include a Run script activity after each SLA Percentage Timer activity. This refreshes the timings in the Task SLA record. (The extra activity is not needed when it breaches as the Task SLA is updated at that point automatically.)

The script in the new activities needs to execute the following line:

SLACalculatorNG.calculateSLA(current, true /* skip update */);

It is important that the second parameter of true is specified. The parameter prevents the calculateSLA function from updating the Task SLA record. This is needed because if this function was to update the record, it would trigger the workflow and cause recursive processing of the Task SLA and its workflow.

The following screenshots show how the base system Default SLA workflow looks after making the modifications.

Default SLA workflow with new refresh SLA timings activities

And the content of each Refresh SLA timings activity:

Related Problem: PRB661061

Seen In

Calgary Patch 4
Eureka Patch 11
Eureka Patch 11 Hot Fix 2
Eureka Patch 11 Hot Fix 4
Eureka Patch 13 Hot Fix 2
Eureka Patch 13 Hot Fix 5
Fuji Patch 7 Hot Fix 5
Geneva Patch 5
Geneva Patch 6 Hot Fix 2
Geneva Patch 7

Fixed In


Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-04-21 07:08:26