SLA values in the database tables are incorrect

This page is about Time to SLA for Jira On-Prem.

Problem

The Time to SLA database table AO_C5D949_ISSUE_SLA does not hold correct SLA data for issues. The SLA Panel, Time to SLA custom field, or SLA Indicator displays different values from this table.

Diagnosis

  • The Time to SLA plugin uses the AO_C5D949_ISSUE_SLA table to store the intermediate state of SLAs. 

  • We use this intermediate information to speed up the calculation of current SLA values. 

  • Since SLAs contain data that changes over time, such as remaining time, etc. there is no efficient way to keep this kind of data in the database.

Solution

We strongly don’t recommend users get SLA data from database tables.

When an SLA is still running, Time to SLA doesn't update the information about the elapsed duration, overdue duration, and remaining duration on the database (DB).

This is because SLAs have numerous calculated information such as elapsed/remaining/overdue/paused duration and indicator value. These are calculated data, so we don't update the database each second. If the SLA's state changes with the issue update, you can see the change on DB. For example, if your SLA is still in the "paused” status (which means the issue still provides the pause condition), you won't be able to see the paused duration on your DB. Time to SLA can only fill this value after moving from the pause situation.

When you try to get SLA data using DB, you may face such problems, which is why we recommend using REST services. You can always use our REST services to retrieve recent SLA data from issues. Please have a look at our REST documentation

Here is an example request and its results:

Request

Request

GET: /rest/tts-api/1.0/sla/issue/{issue-key}?slaId=1

Response

Response

{
    "paused": false,
    "endDate": "2017-11-03T10:35:22Z",
    "slaTargetSourceName": "Resolved",
    "inNonWorkingDays": false,
    "notMuchTime": 80,
    "formattedWorkingDuration": "1d 1h 35m 22s",
    "formattedRemainingDuration": "6h 24m 38s",
    "slaStatus": "SUCCESS",
    "synchronizing": false,
    "remainingDuration": "PT22H24M38S",
    "elapsedPercentage": 53,
    "class": "class com.tuncaysenturk.jira.plugins.dto.IssueSlaDetailsDto",
    "slaValue": "PT48H",
    "slaOriginSourceName": "Open",
    "inNonWorkingHours": false,
    "slaName": "Resolution Time",
    "workingDuration": "PT25H35M22S",
    "slaId": 1,
    "targetDate": "2017-12-02T09:30:00Z",
    "slaValueType": "SLA_VALUE",
    "started": true,
    "finished": false,
    "workingCalendarName": "8-5 Business Hours",
    "slaOriginType": "STATUS",
    "inCriticalZone": true,
    "slaValueSourceName": "SLA Value",
    "slaTargetType": "STATUS",
    "startDate": "2017-10-02T09:30:00Z",
    "slaValueAsDurationString": "2d"
}