SLA search 3.0
This page is about Time to SLA for Jira Data Center.
JQL (Jira Query Language) allows you to search for issues based on their SLA status, duration, target dates, and more. Time to SLA extends Jira’s JQL capabilities with custom SLA-related functions.
On this page: |
---|
Prerequisites
Before using SLA JQL functions, ensure the following:
You have basic knowledge of JQL. If you're new to JQL, learn more here.
You are in Advanced search mode in Jira (SLA functions are not available in Basic mode).
If you use multiple SLA JQL functions, you must use slaJoin. Learn how to join SLA functions here.
What is slaFunction?
Time to SLA adds the slaFunction custom field upon installation. This custom field cannot be added to screens; however, it can be used for JQL search, allowing better app performance.
Other Jira plugins may provide functions with the same name (for example, isNotStarted
). In such cases, Jira will execute the function from the first plugin alphabetically. For more information, refer to this Jira ticket.
State functions
These functions filter issues based on the current state of their SLA. They support =
and !=
operators.
Function | Description | Example |
---|---|---|
isNotStarted([Optional List of SLA IDs or/and Name(s)]) | Finds issues with at least one inactive SLA. |
|
isFinished([Optional List of SLA IDs or/and Name(s) ]) | Finds issues with at least one finished SLA. |
|
isRunning([Optional List of SLA IDs or/and Name(s)]) | Finds issues with at least one running SLA. |
|
isPaused([Optional List of SLA IDs or/and Name(s)]) | Finds issues with at least one paused SLA. |
|
Duration functions
These functions filter issues based on elapsed, remaining, or breached SLA durations. Supported operators: >
, >=
, <
, <=
.
SLA calendars are considered when interpreting duration values.
Function | Description | Example |
---|---|---|
remainingDuration(Duration, [Optional List of SLA IDs or/and Name(s)]) | This function compares the given duration with the remaining duration of SLAs and finds issues where at least one SLA satisfies the comparison. |
|
elapsedDuration(Duration, [Optional List of SLA IDs or/and Name(s)]) | This function compares the given duration with the elapsed duration of SLAs and finds issues where at least one SLA satisfies the comparison. |
|
breachDuration(Duration, [Optional List of SLA IDs or/and Name(s)]) | This function compares the given duration with the breach duration of SLAs and finds issues where at least one SLA satisfies the comparison. |
|
Date functions
These functions filter issues based on SLA start, target, or end dates. Supported operators: >
, >=
, <
, <=
.
When using duration strings instead of exact dates, the SLA’s configured calendar is taken into account while interpreting the values.
Time functions operate the same way as Jira time functions and can be used to define relative time references. The available time functions are:
startOfDay()
startOfWeek()
startOfMonth()
startOfYear()
endOfDay()
endOfWeek()
endOfMonth()
endOfYear()
Usage examples
startOfMonth()
→ Returns the start of the current month.startOfMonth(+1)
,startOfMonth(+1M)
,startOfMonth(inc)
→ Returns the start of the next month.startOfMonth(-1)
,startOfMonth(-1M)
→ Returns the start of the previous month.
Function parameters
Time functions accept an optional increment or decrement parameter in the format:(+|-) nn (y|M|w|d|h|m)
, where:
y
= yearsM
= monthsw
= weeksd
= daysh
= hoursm
= minutes
For example:
startOfWeek(-2w)
→ Returns the start of the week two weeks ago.endOfDay(+3d)
→ Returns the end of the day three days from now.
Function | Description | Example |
---|---|---|
slaStartDate(Date or Duration or timeFunction, [Optional List of SLA IDs or/and Name(s)]) | This function compares the given date or the given duration string with the start date of SLAs and finds issues where at least one SLA satisfies the comparison. |
slaFunction > slaStartDate("endOfMonth(-1)") slaFunction > slaStartDate("startOfDay(+2h)", 1) slaFunction <= slaStartDate("endOfWeek(+2d)", 1 , 2) |
slaTargetDate(Date or Duration or timeFunction, [Optional List of SLA IDs or/and Name(s)]) | This function compares the given date or duration string with the target date of SLAs and finds issues where at least one SLA satisfies the comparison. |
slaFunction > slaFunction > slaFunction <= |
slaEndDate(Date or Duration or timeFunction, [Optional List of SLA IDs or/and Name(s)]) | This function compares the given date or duration with the end date of SLAs and finds issues where at least one SLA satisfies the comparison. |
slaFunction > slaFunction > slaFunction <= |
Percentage functions
These functions filter issues based on the elapsed or remaining percentage of an SLA. Supported operators: >
, >=
, <
, <=
.
Valid percentage values: 10, 20, 25, 30, 40, 50, 60, 70, 75, 80, 90.
Function | Description | Example |
---|---|---|
remainingPercentage(Percentage, [Optional List of SLA IDs or/and Name(s)]) | This function compares the given percent with the remaining percentage of SLAs and finds issues where at least one SLA satisfies the comparison. |
|
elapsedPercentage(Percent, [Optional List of SLA IDs or/and Name(s)]) | This function compares the given duration with the elapsed percentage of SLAs and finds issues where at least one SLA satisfies the comparison. |
|
Breach functions
These functions filter issues based on whether an SLA has been breached. Supported operators: =
and !=
.
Function | Description | Example |
---|---|---|
isBreached([Optional List of SLA IDs or/and Name(s)]) | Finds issues that have at least one breached SLA on it. |
|
Critical zone functions
These functions filter issues where an SLA is in the critical zone. Supported operators: =
and !=
.
Function | Description | Example |
---|---|---|
isInCriticalZone([Optional List of SLA IDs or/and Name(s)]) | Finds issues that have at least one SLA in the critical zone. |
|
Business hours functions
These functions filter issues based on whether an SLA is within business hours. Supported operators: =
and !=
.
Function | Description | Example |
---|---|---|
isInBusinessHours([Optional List of SLA IDs or/and Name(s)]) | Finds issues that have at least one SLA in business hours. |
|
Contains SLA function
Filters issues based on whether they contain a specific SLA. Supported operators: =
and !=
.
Function | Description | Example |
---|---|---|
containsSla([List of at least 1 SLA ID or/and Name(s)]) | Finds issues that contain the listed SLAs. |
|
Complex functions
Complex Functions filter issues for a given complex state of the SLA. These functions check state equality, so you can only use = or != as operands.
Function | Description | Example |
---|---|---|
isMet([Optional List of SLA IDs or/and Name(s)]) | Finds issues that have at least one met SLA on it. |
|
isAllMet([Optional List of SLA IDs or/and Name(s)]) | Finds issues that all SLAs are met on it. |
|
isNotBreachedAndNotFinished([Optional List of SLA IDs or/and Name(s)]) | Finds issues that have at least one SLA which is not breached and not finished on it. |
|
isAllNotBreachedAndNotFinished([Optional List of SLA IDs or/and Name(s)]) | Finds issues that all SLAs which is not breached and not finished on it. |
|
SLA definition queries
Description | Example |
---|---|
Find the issue details that don’t have an SLA definition (any part of the SLA definition). |
|
Find the issue details that have at least one SLA definition on them. |
|