---
title: "SLA values in the database tables are incorrect"
canonical: "https://support.appfire.com/space/TTS/49741946/SLA%20values%20in%20the%20database%20tables%20are%20incorrect"
format: markdown
---
> Macro (aura-html)

> ℹ️ This page is about **Time to SLA for** **Jira Data Center**.

## <span style="color: #0e101a">Problem</span>

<span style="color: #000000">The Time to SLA database table </span><span style="color: #000000">**AO_C5D949_ISSUE_SLA **</span><span style="color: #000000">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.</span>

## <span style="color: #0e101a">Diagnosis</span>

- <span style="color: #000000">The Time to SLA plugin uses the </span><span style="color: #000000">**AO_C5D949_ISSUE_SLA **</span><span style="color: #000000">table to store the intermediate state of SLAs. </span>
- <span style="color: #000000">We use this intermediate information to speed up the calculation of current SLA values. </span>
- <span style="color: #000000">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.</span>

## <span style="color: #000000">Solution</span>

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. <span style="color: #000000">You can always use our REST services to retrieve recent SLA data from issues. Please have a look at </span><span style="color: #000000">[our REST documentation](https://appfire.atlassian.net/wiki/spaces/TTS/pages/46662426)</span><span style="color: #0e101a">. </span>

<span style="color: #000000">Here is an example request and its results:</span>

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

| **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"`  
`}` |