Forums

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

Jira sub-filter to hide certain tasks older than 1 day

Paul January 26, 2024

Hi

I have introduced the below sub-filter to my Kanban board to do the following

  1. Show all tickets that are not resolved.
  2. Hide resolved tasks older than 1 day where given labels are present
  3. Hide resolved tasks older than 7 days where given labels are not present

resolved is EMPTY OR labels in (Label_1, Label_2) AND resolved >= -1d OR labels not in (Label_1, Label_2) AND resolved >= -7d

The issue I am experiencing is that I have found some tickets that are being hidden where they have been resolved within the last 7 days with no labels present. 

How can I modify the above sub-filter to yield the above requirements?

Thank you.  

 

1 answer

1 vote
Jack Brickey
Community Champion
January 26, 2024

edited!! I needed to change the #3 component to be "<= -7d" since you want issues that have been resolved at least 7d in the past. If you actually want more than 7d ago then remove the "=".



I assume that your #2 and #3 are also resolved issues.

Try this...

resolution is EMPTY OR (resolution is not empty and labels in (Label_1, Label_2) AND resolved >= -1d) OR (resolution is not empty and labels not in (Label_1, Label_2) AND resolved <= -7d)

you will note that I am using "resolution". I am assuming you are setting this field for all issues when they move to a done statuscategory.

Paul January 26, 2024

Hi @Jack Brickey 

Thanks for the prompt reply. It looks like this is resulting in the same issue.

I can see the Resolution and Resolved fields are being updated correctly. When a ticket is moved to resolved, the Resolution field is being set to Done and the Resolved field is being set to dd/mm/yyyy


I have just found that when looking through the history of the ticket I can see it has been previously withdrawn by mistake and after running through a test it looks like this is the culprit. 

What I don't understand is that the fields are all being updated correctly after correcting the ticket from withdrawn to resolved, so why isn't the sub-filter working?

Jack Brickey
Community Champion
January 26, 2024

So I assume that the culprit is moved from done to some 'not-done' status which results in the resolution being cleared along with the resolved date. Then if it is moved to Done again the resolution and resolved date are set. I need to see the details of this issue to understand how it is filtered based on the current filter.

please share the current filters you have (primary and sub filters) and the labels and resolved date. Screenshots are best

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2024

Yes, and...I recall the Kanban sub-filter removes all parentheses, so the query must be written in a way to ensure its Boolean order of precedence matches what is needed for the results.

I recommend writing the query stand-alone in the all-issues search first, creating it step by step without parentheses (except for any IN / NOT IN checks) to confirm it works as expected.  Then use it with the board.

And a work-around for the resolution changing problem may be to use statusCategory and statusCategoryChangedDate fields.

Paul January 26, 2024

Thanks @Jack Brickey

Please see the below screenshots

 

Primary Filter

Filter Query.jpg

Sub-filter

Sub-Filter.jpg

JQL Query showing story and field values

JQL Query.jpg

Lifecycle of ticket affected ticket

Lifecycle.jpg

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events