---
title: "Order issues by SLA"
canonical: "https://support.appfire.com/space/TTS/49775561/Order%20issues%20by%20SLA"
format: markdown
---
> Macro (aura-html)

Time to SLA allows you to **sort issues by SLA attributes** in Jira’s Advanced Issue Search. You can order issues based on the following attributes:

- Elapsed duration
- Remaining duration
- Start date
- End date
- Target date
- TTS Custom Field (Start, End, Target)* *(only available in Time to SLA 10.9 and later)*

Ordering by SLA attributes is useful for identifying issues with approaching deadlines, prioritizing breached SLAs, or reviewing SLA performance.

## Prerequisites

Before using SLA ordering functions, ensure the following:

- You are using Time to SLA version 9.8 or later.
- You are in Advanced Search mode in Jira (ordering by SLA attributes is not available in Basic Search).
- If you are upgrading from a version earlier than 9.8, you must reindex issues with SLAs for ordering to function correctly.
  - **Full reindex** – Reindexes all issues in Jira.
  - **Background reindex** – Allows reindexing without impacting Jira’s performance.
  - **Project reindex** – Reindexes only selected projects.

## Order issues by SLA attributes in issue search

1. Go to **Issues** >** Search for Issues**.
2. Switch to **Advanced Search mode**. *(Ordering by SLA attributes is only available in Advanced Search.)*
3. <span style="color: #000000">Type your JQL query. </span>
4. <span style="color: #000000">Append the </span>`ORDER BY`<span style="color: #000000"> clause with any of our order by SLA functions.</span>

### <span style="color: #000000">Available SLA order functions</span>

| **Function** | **Description** | **Example JQL query** |
| --- | --- | --- |
| `slaElapsedDuration` | Order SLAs by elapsed duration. | `project = TIS ORDER BY slaElapsedDuration` |
| `slaRemainingDuration` | Orders issues by remaining SLA duration. | `project = TIS ORDER BY slaRemainingDuration` |
| `slaStartDate` | Order SLAs by start date. | `project = TIS ORDER BY slaStartDate` |
| `slaEndDate` | Order SLAs by end date. | `project = TIS ORDER BY slaEndDate` |
| `slaTargetDate` | Order SLAs by start date. | `project = TIS ORDER BY slaTargetDate` |

## Handling multiple active SLAs

If an issue contains multiple SLAs, Time to SLA sorts issues based on the first SLA within each issue:

- **Ascending order (**`ASC`**)** → Uses the SLA with the shortest duration or earliest date.
- **Descending order (**`DESC`**)** → Uses the SLA with the longest duration or latest date.

For example, if an issue has two SLAs (one ending in 2 hours and another in 5 hours) sorting by `ORDER BY slaRemainingDuration ASC` will prioritize the 2-hour SLA for ordering.