How to clear Resolved (Done) issues from the board based on a specific weekday

Vitor Seabra March 22, 2023

Hi folks!

I want to insert a subfilter to clear from the board all cards moved to Done after a while.

I guess the best way is working with ResolutionDate once I can get them by this parameter.

But the thing is that I want that happening on each Thursday, skipping a week.

For instance, let pretend that today is Thursday and the Done column got cleared by this rule. I want that it happens again in 14 days (2 Thursdays ahead).

What would be the best JQL expression to insert in the subfilter?

 

Thank you in advance!

1 answer

1 accepted

0 votes
Answer accepted
habib rahman
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.
March 22, 2023

Hi @Vitor Seabra  My name is Habib I will do my best to help with the request:


To achieve this, you can create a Jira filter with the JQL query that selects the issues that were resolved the last Thursday, but not the ones before that. Then, you can use this filter as a subfilter in the board's configuration to hide these issues from the board.
Here is an example of a JQL query that should work for you:
```
resolutiondate >= startOfWeek("-2w") and resolutiondate < startOfWeek("-1w")
```
For example, this is how it will look:
Screenshot 2023-03-22 at 18.40.29.png
This selects all issues that were resolved between the start of the week two weeks ago and the start of the week one week ago. This will give you all the issues that were resolved during the last week, but not the week before that.
You can create a filter with this query and then use it as a subfilter in the board's configuration to hide the issues from the board.

To automate the process of clearing the board every two weeks on Thursday, you can create a Jira automation rule that runs on Thursdays and executes a Jira board command to clear the done column. I will show you the steps for you to create Jira automation which is awesome. You can read more about it here: atlassian jira automation 

To create the automation in Jira with the specified condition, you can follow these steps:

1. Log in to your Jira account.
2. Go to the project and setting scroll down to Automation

3. Give the rule a suitable name and choose the Jira project(s) or board(s) you want to apply the rule to.
4. In the "Starting events" section, add the "Scheduled" trigger and set it to run every two weeks.
5. Configure the schedule so that the rule runs on Thursdays (or whichever day you prefer).
6. Add a "Search for issues" action to the rule, and set the JQL expression to `resolutiondate >= startOfWeek("-2w") and resolutiondate < startOfWeek("-1w")`.
7. This JQL expression will search for all issues in the Done status whose resolution date is between the start of two weeks ago and the start of last week.
8. Add an "Update issue" action to the rule to set the resolution of each matching issue to "Done" (or any other suitable status that you prefer). 


```
{
"actions": [
{
"action": "updateIssue",
"params": {
"status": {
"id": "done"
}
}
}
],
"conditions": [
{
"condition": "issueMatches",
"params": {
"jql": ""
}
}
],
"name": "",
"description": ""
}
```

Replace `` with your actual JQL query that matches the issues you want to update, and replace `` and `` with your desired values.
9. Save the automation rule and it will start running on the specified schedule, clearing all cards from the Done column that match the JQL sub-filter.
Screenshot 2023-03-22 at 18.59.38.pngScreenshot 2023-03-22 at 18.59.30.png

By following these steps, your automation in Jira will run on a recurring schedule every two weeks starting from Thursday, and will clear cards from the board based on the sub-filter defined by the JQL expression.

I hope this helps. If this works for you please leave a like and accept the answer so other if who have the same issue can benefit from this.
Thank you 
Habib
Vitor Seabra March 22, 2023

Amazing, Habib! Thank you so much!

My only concern using StartofWeek would be that it aims to Mondays and I want my process looking for Thursdays as the clearing trigger. Would that work in this way?

 

Regards.

Suggest an answer

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

Atlassian Community Events