3

I need a JQL filter that matches what's in the backlog, and have the same order as the backlog.

My product owner and I ordered all the backlog, and I need my filter to reflect that.

My current attempt has about five and a half times as many items as the backlog...900 vs 159 actual items in the backlog

project="Project Name" AND issuetype != Epic AND (Sprint is EMPTY OR Sprint not in (openSprints(), futureSprints())) and status != Closed Order by RANK

The order isn't correct either.

How do I filter items to match what the backlog has, and show the same order?

Robert Achmann
  • 1,986
  • 3
  • 40
  • 66
  • I found that the following works great: project = "Project Name" AND issuetype not in (epic, subTaskIssueTypes()) AND (Sprint is EMPTY OR Sprint not in (openSprints(), futureSprints())) AND status not in (Closed, Accepted, Delivered) ORDER BY RANK ASC – Robert Achmann May 18 '16 at 20:02

2 Answers2

5

If you check the configuration of your board, it will have a few Filter settings that specify which issues have to be displayed on your board and backlog. Documentation is available here. The screen looks like this:

enter image description here

With the contents of the Saved Filter and Filter Query fields you should be able to build the JQL query that matches your backlog. The Ranking field specifies how issues are ordered, but typically this is done by their Rank, which you already use in your JQL. You can add ASC or DESC to change the direction of the order, ie. ORDER BY RANK DESC.

These rules determine which issues are visible in the backlog for your board:

An issue will only be visible in the Backlog if:

  • the issue is not a Sub-Task,
  • the issue matches the board's Saved Filter (see Configuring Filters),
  • the issue's status maps to one of the board's columns (but not the 'Done' column), and
  • there is at least a status being mapped to the right most column. Eg. If you have the columns To Do, In Progress , and Done, ensure that you have a status mapped to In Progress at least. If you map all the statuses to the first column (To Do), you will not be able to see any issues in the Backlog.

This is taken from this documentation page.

Community
  • 1
  • 1
GlennV
  • 3,471
  • 4
  • 26
  • 39
  • I found a solution (see above), but for the displayed backlog in front of you, what 'saved filter' or 'filter query' are you looking at? I don't see where to view the components of the backlog query. My only starting point is 'clear all filters' at the top of the backlog list. I might have over 2000 issues, but my backlog only has 157 of those, with no filters on – Robert Achmann May 18 '16 at 20:06
  • @RobertAchmann, good that you've already found the correct JQL. I've added more details to my answer that hopefully explains why your JQL does its job. – GlennV May 18 '16 at 21:11
1

Here is the answer that worked for me

project = <your project> AND issuetype in (task, "Task ", Story, Improvement, Improvements, Research, Bug, Incident) AND status not in (Done, CANCELLED, Closed) AND (Sprint in (futureSprints()) OR Sprint is EMPTY) ORDER BY rank

  • Changed the parameters according to your project.

  • Order by rank - gives you the order you see in the backlog

Cheers

shanika
  • 11
  • 3
  • To also show issues that were once in a sprint but moved back to the backlog, I'd replace `(Sprint in (futureSprints()) OR Sprint is EMPTY)` with **`(Sprint not in openSprints() OR Sprint is EMPTY)`**. – Johnny Feb 16 '23 at 16:39