REST APIs
This page is about Time to SLA for Jira Cloud. Using Data Center? Click here.
Time to SLA provides powerful REST APIs to help you view and manage your SLA configurations, calendars, notifiers, issues, and permissions.
Here's an overview of what you can do:
View and manage SLAs
Get a list of all SLAs
Retrieve SLA configuration details by ID
Create a new SLA configuration
Update an existing SLA
Delete an SLA
Clone an SLA from an existing SLA
View and manage SLA notifications and global notifications
Get all SLA notifications for a specific SLA
Retrieve all global notifications defined in TTS
Get a notification configuration using SLA ID and notifier ID
Create a new notification configuration.
Update an existing notification configuration
Delete a notification by SLA ID and notifier ID
View and manage Calendars
Get all defined calendars in the plugin
Retrieve specific calendar configuration by ID
Create a new calendar
Update an existing calendar
Delete a calendar by ID
View all Issues
Retrieve all SLAs associated with a specific issue by SLA ID
Get SLA details for an issue using the issue ID and SLA ID
Recalculation
Get all recalculation records
Start recalculation using JQL
Abort recalculation
Permissions
View all permissions
Update permissions
Prerequisites
Before you begin using the REST APIs, ensure you meet the following prerequisites:
You must have the necessary permissions to access and manage SLAs, calendars, notifiers, or other configurations.
A valid JWT token is required for authorization. Follow the steps below to generate one.
Use Postman or another API testing tool to test and integrate the REST APIs.
For more information, refer to the REST API documentation.
How to create a token
To use the REST APIs, you need a JWT token for authentication. Follow these steps:
Navigate to Settings > API Token.
Click New Token. The token creation dialog opens.
Configure your token:
Name your token.
Select when it'll expire, or check the Never expire box if you want the token to remain active indefinitely.
Determine the level of access that the token will have.
Security note
Avoid using tokens that never expire. If such a token is exposed, it must be deleted manually, as it will not expire automatically.
Click Save. The JWT Token appears.
Save the JWT Token by clicking the copy button. Note that you won’t be able to access this code after closing the dialog.
Click Cancel after copying the token, and the token will appear on the main page.
Replace {{jwtToken}} in the header with your token.
How to grant JWT permission (Using Postman)
Here’s how to set up JWT authorization using Postman:
Click Run in Postman > Postman for Web.
On the Postman main page, click Workspaces > My Workspaces.
Click the plus button to add a new permission.
Copy and paste the link of the token you’ve chosen.
Click Headers.
Under KEY, enter Authorization.
Under VALUE, enter
Bearer {your token}
(replace{your token}
with the token you generated).Click Send to authenticate.
Your JWT authorization is now active.
Rest call example
Here’s an example API request with definitions for key parameters in the response:
Example Response for “Get Issue SLA of Issue” | Meaning |
---|---|
| This is the SLA’s goal. |
| This is also related to the the SLA goal. We keep this value in milliseconds. |
| 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. |
| 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. |
| 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. |
| Elapsed time is the total time the SLA has taken until this time. |
| The time left until the SLA breaches. |
| The time that has passed since the SLA was breached. |
| The length of time that SLA has been paused. |
| This value is the same with |