BA Prince the B.A. Subscribe

Home / Jira & Confluence for BAs

Advanced JQL for Business Analysts (Functions, Dates, ORDER BY)

Advanced JQL for Business Analysts (Functions, Dates, ORDER BY)

Watch on YouTube Subscribe

Go past basic Jira searches: a function for the current sprint, IN for a list of values, a date filter, IS NOT EMPTY and ORDER BY on story points. One query, built up step by step on a real Jira site.

Step by step

Beyond the basics

  1. Advanced JQL. Basic JQL finds work items. Advanced JQL answers the questions stakeholders actually ask, such as what is left in this sprint and which piece is the biggest. Here one query is built up step by step.
  2. Switch to JQL. On the Jira search page, switch to JQL.

Build the query

  1. A function. Select everything in the search box and type project = SCRUM AND sprint IN openSprints(). The function openSprints(), with its round brackets, means the sprint that is running now, so the same query still works next sprint. Search. Jira finds 9 work items in the current sprint.
    project = SCRUM AND sprint IN openSprints()
  2. IN a list. To keep only the open ones, add AND status IN ("To Do", "In Progress") at the end. IN checks a list of values. Names with spaces go in quotes. Search again. 5 work items are still open.
    AND status IN ("To Do", "In Progress")
  3. Dates. Add AND created >= "2026-10-01" to keep work items created on or after 1 October 2026. Dates are year-month-day, in quotes. For a moving window, write -30d instead, which means the last 30 days.
    AND created >= "2026-10-01"
  4. IS NOT EMPTY. Bugs on this site have no story points. Add AND "Story point estimate" IS NOT EMPTY to skip work items where that field is blank. ("Story point estimate" is the team-managed name; company-managed projects usually use "Story Points".)
  5. ORDER BY. Last, set the order. Add ORDER BY "Story point estimate" DESC so the biggest piece of work comes first. Search. 4 stories with an estimate are left, now sorted by size.
    ORDER BY "Story point estimate" DESC

Read the answer

  1. Biggest first. On top is Pay by card at checkout, at 5 points. That is the story to ask about in the daily stand-up.
  2. Check the count. Always check the count at the bottom of the results. If it looks wrong, read your query again, one condition at a time.

Recap

  1. Function, IN, date, order. Functions like openSprints() keep a query up to date. IN checks a list. Dates go in quotes. IS NOT EMPTY skips blanks. ORDER BY puts the biggest answer on top.

Common mistakes

  • No quotes around names with spaces. status IN (To Do, In Progress) gives an error, because Jira can't tell where each name ends. Write status IN ("To Do", "In Progress"). Field names with spaces need quotes too, like "Story point estimate".
  • Typing the sprint name instead of using openSprints(). A query with a fixed sprint name goes stale when the next sprint starts. sprint IN openSprints() always points at the sprint that is running now.
  • Dates in the wrong format. Write dates as year-month-day in quotes, like "2026-10-01", not 01/10/2026. For a window that moves with today, use -30d.
  • ORDER BY in the middle of the query. ORDER BY must come last, after every AND condition. Put new conditions before it, or the query won't run.

When a business analyst uses this

Before the daily stand-up, a business analyst runs this query to see which open stories in the current sprint have an estimate, biggest first, and asks about the top one. Because openSprints() follows whichever sprint is running, the same query works every sprint with no edits.

Questions people ask

What does openSprints() do in JQL?

It means the sprints that are running right now. sprint IN openSprints() keeps a query current, so you don't have to change the sprint name every sprint.

How do I find Jira issues created in the last 30 days?

Use created >= -30d. It counts back 30 days from today, so the window moves forward with the date.

How do I sort JQL results by story points?

End the query with ORDER BY "Story point estimate" DESC to show the biggest first, and add "Story point estimate" IS NOT EMPTY before it to skip items with no estimate. Company-managed projects usually call the field "Story Points".

More in Jira & Confluence for BAs