REST APIs

This page is about Time to SLA for Jira Cloud. Using Jira On-Prem? Click the On-Prem button above.

Rest APIs can help you edit and view your SLA data.

  1. View and manage your SLAs

  2. Get all the SLAs that you have

  3. Get an SLA Configuration by id

  4. Create an SLA Configuration

  5. Update an existing SLA

  6. Delete an SLA

  7. Clone an SLA from an existing SLA

  8. View/manage your calendars

  9. Get all the calendars that are defined in the plugin

  10. Get specific calendar configuration by id

  11. Create a new calendar

  12. Update an existing calendar

  13. Delete the calendar with id

  14. View/manage SLA notifiers and global notifiers

  15. Get all the notifiers that the SLA has

  16. Get all the global notifiers that are defined in TTS

  17. Get specific SLA notifier configuration with SLA id and notifier id

  18. Create a new notifier configuration

  19. Update an existing notifier configuration

  20. Delete notifier with SLA id and notifier id

  21. View all issues

  22. Get all issued SLAs with SLA id

  23. Get issue SLA of an issue with its issue id and SLA id

  24. Get all recalculation records

  25. Start recalculation with JQL

  26. Abort recalculation

  27. Get all permissions

  28. Update permissions

To use these APIs, you need a JWT token for authorization.

To create a new token:

  1. Navigate to Settings > API Token.

  2. Click New Token to create a token.

  3. Name your token, select when it'll expire, or check the Never expire box to make sure the token doesn’t expire in a certain time period, and how much access it will have. Click Save.

For security reasons, we do not recommend generating tokens that never expire. Please be aware that if this token is somehow exposed, you will need to delete it manually, as it will not expire automatically.

  1. The JWT Token will appear. Save it by clicking the icon shown below. Keep in mind that you won’t be able to access this code after closing the pop-up.

  1. Click Cancel after copying the token, and the token will appear on the main page.

  2. Replace {{jwtToken}} in the header with your token.

How to Give JWT Permission:

We’ll give you an example of giving JWT authorization using Postman.

  1. Open the TTS REST APIs documentation.

  2. Click Run in Postman > Postman for Web.

  3. On the Postman main page, click Workspaces > My Workspaces.

  4. Click to add a new permission.

  5. Here, to give authorization, first copy and paste the link of the token you’ve chosen from here.

  1. Click Headers.

  2. Under KEY, write Authorization.

  3. Under Value, write “Bearer (paste the token you’ve created and copied)

  4. Click Send.

  5. Tada! You’ve successfully given the JWT authorization.

Rest Call Example

For better comprehension, we included definitions for some values of an example response below.

Example Response for “Get Issue SLA of Issue”

Meaning

Example Response for “Get Issue SLA of Issue”

Meaning

slaValueType

This is the SLA’s goal.

slaValue

This is also related to the the SLA goal. We keep this value in milliseconds.

startDate

If the SLA has started, this will show the start date. We keep this value in unix timestamp. If you want to convert it to human readable form date, you can use a converter.

endDate

If the SLA has finished, this will show the end date. We keep this value in unix timestamp. If you want to convert it to human readable form date, you can use a converter.

deadline

This is the Target Date. We keep this value in unix timestamp. If you want to convert it to human readable form date, you can use a converter.

elapsedDuration

Elapsed time is the total time the SLA has taken until this time.

remainingDuration

The time left until the SLA breaches.

overdueDuration

The time that has passed since the SLA was breached.

pausedDuration

The lenght of time that SLA has been paused.

workingDuration

This value is the same with elapsedDuration.

Related Articles