/
SLA search 3.0

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.

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

Function

Description

Example

isNotStarted([Optional List of SLA IDs or/and Name(s)])

Finds issues with at least one inactive SLA.

slaFunction = isNotStarted()

slaFunction = isNotStarted(SLAid1,SLAid2)

slaFunction = isNotStarted("SLA Name 1","SLA Name 2")

isFinished([Optional List of SLA IDs or/and Name(s) ])

Finds issues with at least one finished SLA.

slaFunction = isFinished()

slaFunction = isFinished(SLAid1,SLAid2)

slaFunction = isFinished("SLA Name 1","SLA Name 2")

isRunning([Optional List of SLA IDs or/and Name(s)])

Finds issues with at least one running SLA.

slaFunction = isRunning()

slaFunction = isRunning(SLAid1,SLAid2)

slaFunction = isRunning("SLA Name 1","SLA Name 2")

isPaused([Optional List of SLA IDs or/and Name(s)])

Finds issues with at least one paused SLA.

slaFunction = isPaused()

slaFunction = isPaused(SLAid1,SLAid2)

slaFunction = isPaused("SLA Name 1","SLA Name 2")

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

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.

slaFunction <= remainingDuration("4h")

slaFunction < remainingDuration("1d", 5, 7)

slaFunction < remainingDuration("1d", "SLA Name 1","SLA Name 2")

slaFunction >= remainingDuration("5d", 2, 6, 12)

slaFunction >= remainingDuration("5d", "SLA Name 1","SLA Name 2", "SLA Name 3")

slaFunction > remainingDuration("5d", 2, 6, 12)

slaFunction > remainingDuration("5d","SLA Name 1","SLA Name 2", "SLA Name 3")

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.



slaFunction <= elapsedDuration("4h")

slaFunction < elapsedDuration("1d", 5, 7)

slaFunction < elapsedDuration("1d", "SLA Name 1","SLA Name 2")

slaFunction >= elapsedDuration("5d", 2, 6, 12)

slaFunction >= elapsedDuration("5d", "SLA Name 1","SLA Name 2", "SLA Name 3")

slaFunction > elapsedDuration("5d", 2, 6, 12)

slaFunction > elapsedDuration("5d", "SLA Name 1","SLA Name 2", "SLA Name 3")

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.



slaFunction <= breachDuration("4h")

slaFunction < breachDuration("1d", 5, 7)

slaFunction < breachDuration("1d", "SLA Name 1","SLA Name 2")

slaFunction >= breachDuration("5d", 2, 6, 12)

slaFunction >= breachDuration("5d", "SLA Name 1","SLA Name 2", "SLA Name 3")

slaFunction > breachDuration("5d", 2, 6, 12)

slaFunction > breachDuration("5d", "SLA Name 1","SLA Name 2", "SLA Name 3")

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 = years

  • M = months

  • w = weeks

  • d = days

  • h = hours

  • m = 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

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("2019-07-01")

slaFunction < slaStartDate("-5d")

slaFunction > slaStartDate("-20d", 4, 6, 8)

slaFunction > slaStartDate("-20d", "SLA Name 1","SLA Name 2", "SLA Name 3")

slaFunction >= slaStartDate("2019-04-01 13:00", 1, 2)

slaFunction >= slaStartDate("2019-04-01 13:00", "SLA Name 1","SLA Name 2")

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 <= slaTargetDate("2019-07-01")

slaFunction < slaTargetDate("-5d")

slaFunction > slaTargetDate("-20d", 4, 6, 8)

slaFunction > slaTargetDate("-20d", "SLA Name 1","SLA Name 2", "SLA Name 3")

slaFunction >= slaTargetDate("2019-04-01 13:00", "SLA Name 1","SLA Name 2")

slaFunction > slaTargetDate("endOfMonth(+2w)")

slaFunction > slaTargetDate("startOfWeek(inc)", 1)

slaFunction <= slaTargetDate("endOfYear(-2M)", 1 , 2)

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 <= slaEndDate("2019-07-01")

slaFunction < slaEndDate("-5d")

slaFunction > slaEndDate("-20d", 4, 6, 8)

slaFunction > slaEndDate("-20d", "SLA Name 1","SLA Name 2", "SLA Name 3")

slaFunction >= slaEndDate("2019-04-01 13:00", 1, 2)

slaFunction >= slaEndDate("2019-04-01 13:00", "SLA Name 1","SLA Name 2")

slaFunction > slaEndDate("startOfMonth(+2d)")

slaFunction > slaEndDate("endOfDay(-3h)", 1)

slaFunction <= slaEndDate("endOfYear(-2M)", 1 , 2)

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

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.

slaFunction <= remainingPercentage(10)

slaFunction > remainingPercentage(75)

slaFunction < remainingPercentage(25, 5, 7)

slaFunction < remainingPercentage(25, "SLA Name 1","SLA Name 2")

slaFunction >= remainingPercentage(50, 2, 6, 12)

slaFunction >= remainingPercentage(50, "SLA Name 1","SLA Name 2", "SLA Name 3")

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.



slaFunction <= elapsedPercentage(10)

slaFunction > elapsedPercentage(75)

slaFunction < elapsedPercentage(25, 5, 7)

slaFunction < elapsedPercentage(25, "SLA Name 1","SLA Name 2")

slaFunction >= elapsedPercentage(50, 2, 6, 12)

slaFunction >= elapsedPercentage(50, "SLA Name 1","SLA Name 2", "SLA Name 3")

Breach functions

These functions filter issues based on whether an SLA has been breached. Supported operators: = and !=.

Function

Description

Example

Function

Description

Example

isBreached([Optional List of SLA IDs or/and Name(s)])

Finds issues that have at least one breached SLA on it.

slaFunction = isBreached()

slaFunction = isBreached(SLAid1,SLAid2)

slaFunction = isBreached("SLA Name 1","SLA Name 2")

Critical zone functions

These functions filter issues where an SLA is in the critical zone. Supported operators: = and !=.

Function

Description

Example

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.

slaFunction = isInCriticalZone()

slaFunction = isInCriticalZone(SLAid1,SLAid2)

slaFunction = isInCriticalZone("SLA Name 1","SLA Name 2")

Business hours functions

These functions filter issues based on whether an SLA is within business hours. Supported operators: = and !=.

Function

Description

Example

Function

Description

Example

isInBusinessHours([Optional List of SLA IDs or/and Name(s)])

Finds issues that have at least one SLA in business hours.

slaFunction = isInBusinessHours()

slaFunction = isInBusinessHours(SLAid1,SLAid2)

slaFunction = isInBusinessHours("SLA Name 1","SLA Name 2")

Contains SLA function

Filters issues based on whether they contain a specific SLA. Supported operators: = and !=.

Function

Description

Example

Function

Description

Example

containsSla([List of at least 1 SLA ID or/and Name(s)])

Finds issues that contain the listed SLAs.

slaFunction = containsSla(SLAid1,SLAid2)

slaFunction = containsSla("SLA Name 1","SLA Name 2")

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

Function

Description

Example

isMet([Optional List of SLA IDs or/and Name(s)])



Finds issues that have at least one met SLA on it.

slaFunction = isMet()

slaFunction = isMet(SLAid1,SLAid2)

slaFunction = isMet("SLA Name 1","SLA Name 2")

isAllMet([Optional List of SLA IDs or/and Name(s)])



Finds issues that all SLAs are met on it.

slaFunction = isAllMet()

slaFunction = isAllMet(SLAid1,SLAid2)

slaFunction = isAllMet("SLA Name 1","SLA Name 2")

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.

slaFunction = isNotBreachedAndNotFinished()

slaFunction = isNotBreachedAndNotFinished(SLAid1,SLAid2)

slaFunction = isNotBreachedAndNotFinished("SLA Name 1","SLA Name 2")

isAllNotBreachedAndNotFinished([Optional List of SLA IDs or/and Name(s)])



Finds issues that all SLAs which is not breached and not finished on it.

slaFunction = isAllNotBreachedAndNotFinished()

slaFunction = isAllNotBreachedAndNotFinished(SLAid1,SLAid2)

slaFunction = isAllNotBreachedAndNotFinished("SLA Name 1","SLA Name 2")

SLA definition queries

Description

Example

Description

Example

Find the issue details that don’t have an SLA definition (any part of the SLA definition).

slaFunction is EMPTY

Find the issue details that have at least one SLA definition on them.

slaFunction is not EMPTY