/
REST APIs

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:

  1. You must have the necessary permissions to access and manage SLAs, calendars, notifiers, or other configurations.

  2. A valid JWT token is required for authorization. Follow the steps below to generate one.

  3. 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:

  1. Navigate to Settings > API Token.

  2. Click New Token. The token creation dialog opens.

  3. Configure your token:

    Screenshot 2025-01-26 at 02.58.47.png
    • 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.

  1. Click Save. The JWT Token appears.

  2. Save the JWT Token by clicking the copy button. Note that you won’t be able to access this code after closing the dialog.

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

  4. 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:

  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 the plus button to add a new permission.

  5. Copy and paste the link of the token you’ve chosen.

  1. Click Headers.

  2. Under KEY, enter Authorization.

  3. Under VALUE, enter Bearer {your token} (replace {your token} with the token you generated).

  4. 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

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 length of time that SLA has been paused.

workingDuration

This value is the same with elapsedDuration.