Search code examples
jqlbacklog

JQL filter matching backlog including order


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?


Solution

  • 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.