Going Stellar

Home/JQL reference

JQL keyword

ORDER BY in JQL: syntax and examples

ORDER BY decides the order of the results. List one field or several, each with its own direction, at the very end of the query. Without a direction, the field's own default order is used.

Syntax

... ORDER BY field [ASC | DESC]
... ORDER BY field1 [ASC | DESC], field2 [ASC | DESC]

Arguments

ArgumentWhat it doesOptional
fieldThe field to sort by. Separate several fields with commas.yes
ASC or DESCAscending or descending. Each field takes its own.no

Works with

  • Fields: most fields, including Priority, Created, Updated, Due date, Status, Assignee, Key, Rank
  • Placement: the last part of the query, after every condition
  • Not with: Comment, Text, Attachments and Work item link type

Examples

project = WEB AND statusCategory != Done ORDER BY priority DESC, created ASC

The work list for a stand-up: most urgent first, and oldest first within each priority.

Run on Jira Cloud on .

project = WEB AND statusCategory != Done ORDER BY duedate ASC

Deadlines in order, soonest on top. Work with no due date comes last.

Run on Jira Cloud on .

project = WEB AND sprint is EMPTY AND statusCategory != Done ORDER BY Rank ASC

The unscheduled backlog in the order the team ranked it.

Run on Jira Cloud on .

project in (WEB, MOB) ORDER BY project ASC, status ASC, created DESC

Three sort keys: grouped by project, then by status, then newest first inside each group.

Run on Jira Cloud on .

project = WEB ORDER BY updated DESC, key ASC

Latest activity first, with the key as a tie-breaker so items changed together always appear in the same order.

Run on Jira Cloud on .

project = WEB AND statusCategory != Done ORDER BY created, priority DESC

Each direction belongs to the field before it: created uses its default order and only priority is descending.

Run on Jira Cloud on .

Pitfalls

  • Nothing can follow it except more sort fields. project = WEB ORDER BY created DESC AND status = Done fails with "Expecting ',' but got 'AND'.", and a second ORDER BY fails the same way with "Expecting ',' but got 'ORDER'."
  • Some fields cannot be sorted. ORDER BY comment returns "Field 'comment' does not support sorting.", and the same message appears for text, attachments and issuelinktype. An unknown name gives "Not able to sort using field 'nonexistent'." A direction other than ASC or DESC fails with "Expecting either 'ASC' or 'DESC' but got 'sideways'."
  • Empty values go to the far end. With ORDER BY duedate ASC the undated work is at the bottom, with DESC it opens the list, so a deadline list sorted descending starts with items that have no deadline (checked on Jira Cloud, November 2026).
  • Priority without a direction already lists the highest first, so ORDER BY priority and ORDER BY priority DESC agree, and ASC reverses it (checked on Jira Cloud, November 2026). Atlassian also notes that sorting by component or version groups by space first and only then by the field.

Ready-made queries

Questions and answers

Can I sort by more than one field in JQL?

Yes. Separate the fields with commas, and give each its own ASC or DESC. The first field is the main sort and the later ones break ties.

Sources

  1. JQL keywords (Atlassian Support, Jira Cloud)

Markdown version · All JQL pages