Tickets resolved after due date
Asked by Juan Ignacio Tallarico:

Hello community! Is there any way to have a filter that shows me the tickets resolved in the current month that were resolved after due date?

I've done this exporting the tickets on sheets with a formula resolution date \<= due date but i couldn't find it on Jira.

Thank you!


Answers:
author: Rik de Valk
body: Hi [@Juan Ignacio Tallarico](/t5/user/viewprofilepage/user-id/5446294) ,

JQL doesn't offer a 'date compare' out of the box. You can compare to some relative date functions such as startOfDay(-3d) and such. But comparing two date fields like Resolution date and Due date is not possible.

* As this community question shows in the answers, you can use an App for that (like ScriptRunner): <https://community.atlassian.com/t5/Jira-Software-questions/We-are-trying-to-compare-two-date-timestamp-fields-using-the-JQL/qaq-p/1597868>
* And as this community question shows, you can also do advanced date comparisons in automation: <https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Comparing-Dates/qaq-p/1082379>

So, as a work-around, you could create an automation rule, scheduled to run each month. This rule would compare the resolved date with due date. And in case the resolved date is \> due date, the rule can add a label 'resolved_after_due'.

Once this rule has run, you can create a report filtering on issues with the label 'resolved_after_due'.

Have a nice day! Rik

comments: author: Juan Ignacio Tallarico
body: Thanks for the reply! I will be testing that.


author: Juan Ignacio Tallarico
body: Hi Rik, I did the automation rule and worked just fine! but now I have this problem: When the resolution date is the same day as the due date I don't want it labeled as after due, this is because it's counting hours, minutes and seconds. Do you know a way to solve this?   


author: Rik de Valk
body: Hi,

In the automation rule you can use an Issue feld compare. For example, the rule can trigger on transition to Done.

And then the rule can check if the Due date is BEFORE the moment o firing the rule.

![Screenshot 2024-03-08 at 08.25.15.png](https://community.atlassian.com/t5/image/serverpage/image-id/310981i9CA076AE2BEDE583/image-size/large?v=v2&px=999 "Screenshot 2024-03-08 at 08.25.15.png")

I haven't tested this, but I think this should do the trick.


author: Juan Ignacio Tallarico
body: That made it!

You are the best Rik, thank you very much, have a nice weekend!


author: mruttan
body: Hey There! You should be able to find them using JQL, give this a shot.

```
due <= "0" AND resolved <= "0"
```

comments: author: Juan Ignacio Tallarico
body: Hello, I tried this but didn't work. Thank you!


author: mruttan
body: Thanks for the reply!

I've tested the above and confirmed my results. If you split the query in half, you should be able to test which portion is giving you trouble.

A simple search of

```
due <= "0"
```

Will give you overdue tkts regardless of status.   

The second half will filter for all those tkts resolved after that date.


author: Juan Ignacio Tallarico
body: I used the expression on a filter, but it's giving me wrong results. I missed something?![Captura de pantalla 2024-03-07 114653.png](https://community.atlassian.com/t5/image/serverpage/image-id/310833i29EE7CF278883AAB/image-size/large?v=v2&px=999 "Captura de pantalla 2024-03-07 114653.png")  


author: Charlotte Santos -Appfire-
body: **Hi [@Juan Ignacio Tallarico](/t5/user/viewprofilepage/user-id/5446294)**

I'm Charlotte, a support engineer at Appfire and I'm here to help you.

Unfortunately, using vanilla JQL, you'll not be able to do it dynamically.

In the app where my team works, [JQL Search Extensions for Jira](https://marketplace.atlassian.com/apps/1214791/jql-search-extensions-for-jira-reports?hosting=cloud&tab=overview&utm_source=atlassiancommunity&utm_medium=listinglink&utm_campaign=mauricio), you can use this query find issues resolved in the current month that were resolved after due date:

```
issue in dateCompare("duedate < resolved") AND resolved >= endOfMonth(-1)
```

Please contact our [support](https://appfire.atlassian.net/servicedesk/customer/portal/11) if you have any other questions about this query.

We'll be happy to help you!

comments: author: Juan Ignacio Tallarico
body: Hi! thanks, your app looks great but im looking for a free way to get this done. Thanks anyway!


Tags: cloud

jira-service-management

jira-service-management-cloud