How to get SLA data for a specific Jira issue using REST API

This article explains how to get SLA data for a specific issue using REST API.

Requirements

  • Get SLA data from Jira Issues in the Cloud.

  • Get the issue where SLA is broken.

  • Get the relevant date when the following:

    • SLA started

    • SLA paused

    • SLA resumed

    • SLA finished

STEPS:

  1. Use the REST API function below for a specific issue and SLA.

https://tts.snapbytesapps.com/api/issue-sla/{issueId}/sla/{slaId}
  1. Choose which data to retrieve based on the above Rest API call’s response:

  • Elapsed duration

  • Remaining duration

  • Overdue duration

  • Paused duration

  • Start date

  • Target date (deadline)

  • End date and etc

{ "issueId": "10091", "slaId": "38", "slaName": "Time to Response", "slaValueAsDurationString": "1h", "workingCalendarName": "7x24", "slaValueType": "SLA_VALUE", "slaStartType": {}, "slaTargetType": {}, "percentageThreshold": 80, "slaStatus": "STILL", "slaValue": 3600000, "startDate": 1647419947000, "endDate": null, "deadline": 1647423547000, "elapsedDuration": 235087, "remainingDuration": 3364913, "overdueDuration": 0, "pausedDuration": 0, "elapsedPercentage": 7, "isStarted": true, "isPaused": false, "isFinished": false, "inNonWorkingHours": false, "inNonWorkingDays": false, "lastStatusDate": 1647420182087, "calendarId": "7x24", "workingDuration": 235087, "slaValueForFixedDurations": null }

We do not keep the results value directly in the result of the REST API calls.

If SLA is met:
endDate will not equal to “null“ and the remaining duration will be greater than “0”.

If SLA is breached:
The remaining duration will be equal to “0”.

If SLA is in progress:
endDate will equal to “null“ and the remaining duration will be greater than “0”.

This page is for the Cloud instance.