Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Snippet Library: JQL - Jira Service Management Examples

Here are some helpful queries, formats, and functions to use in Jira Service Management (JSM).

Approvals

There are many helpful JQL functions for querying approval data. A function allows the use of variables in a JQL query. The function substitutes the applicable values at the time the query is run. This avoids the need to hard code static data. E.g. Use a query with a function like assignee = currentUser() instead of the less flexible assignee = “Rachel Wright”.

Common Functions

  • approved()

  • approver()

  • myApproval()

  • myPending()

  • myPendingApproval()

  • pending()

  • pendingBy()

Examples

  • Find items awaiting approval from a specific user

    • approvals = approver(username)

  • Find items pending approval

    • approvals = pending()

Requests

Requests are how Jira items are represented, in the self-service portal, to customers or end users. A request is a simplified view of item data.

Tip: Don’t forget to enclose any multi-word work type or request type names in quotes.

  • Find incidents

    • type = "[System] Incident"

  • Find incidents for a system problem

    • type = "[System] Incident" and "Request Type" = "Report a system problem (project-key)"

  • Find items without a request type

    • "Request Type" is empty

Organizations

Organizations are used to group customers together and determine which requests they can view in the customer portal. You can query by organization membership and name.

Tip: Don’t forget to enclose any multi-word organization names in quotes.

  • Find requests from one or more specific organizations

    • reporter in organizationMembers(organization-name)

    • organizations = organization-name

    • organizations in (organization1, organization2) 

Service Level Agreements

SLAs represent a goal or a commitment between a service provider and a customer. For example, a high priority request might have a completion goal of one hour. A low priority request might have a first response goal of four hours. There are many helpful JQL functions for querying SLA data.

Common Functions

  • breached()

  • completed()

  • elapsed()

  • everBreached()

  • paused()

  • remaining()

  • running()

  • withinCalendarHours()

Examples

  • Find items where an SLA was not met

    • SLA-name = breached()

  • Find items awaiting a resolution for more than 8 hours

    • “Time to Resolution" > elapsed("8h")

Resources

See the Jira Service Management JQL documentation for additional functions, fields, operators, and clauses.


Back to intro or article list

2 comments

Peter_DevSamurai
Atlassian Partner
January 1, 2026

Thank you @Rachel Wright ! Although I don’t use JQL on a daily basis, knowing these is very helpful when I need to find a specific work item. Happy New Year!!!

Like Susan Waldrip likes this
Hope Man
Contributor
August 25, 2026

Hey.

So there is no way to search for approvals of groups? We almost always use groups and not single users, because we provision these groups from Entra ID and don't want to manually maintain sets of users in every project that uses approvals. Sometimes we have statuses where multiple users fro separate groups need to approve in parallel.

The fact that Jira allows you to assign approvals to groups, but then completely fails to provide native JQL to query those specific groups mid-approval, is a massive architectural oversight.

On another note: I fail to understand why we need so many approval-related JQL functions. We could have just stayed consistent and used this syntax: 'pendingBy(currentUser)' instead of myPending().
Other uses of currentUser include 'text ~ currentUser()' or 'watcher = currentUser()'

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events