How to make a filter to find issues resolved the same day that they where created

javier_gallego_ezpeleta February 20, 2020

Hello, 

I need to list the issues that are solved the same day that were created. I try to use creater=resolved, but it doesn't work. 

Thnx.

5 answers

1 vote
sheriff December 3, 2021

Here is the working query for me:

project = MyProject AND created >= 2021-11-29 AND created < 2021-12-05 AND issueFunction in expression("", "created.clearTime()==resolutionDate.clearTime()") ORDER BY created DESC, updated DESC

where:

created >= 2021-11-29 AND created < 2021-12-05 - any period you're looking issues in

issueFunction in expression("", "created.clearTime()==resolutionDate.clearTime()") - the condition, that converts Date-Time format of "created" and "resolutionDate" to only Date-format and compares the received dates with each other

Note, that you need using plugin (I'm using ScriptRunner)

0 votes
Payne
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.
February 21, 2020

Another idea that make work for you; it's a bit cumbersome, but it gives the desired data. Perform an issue search, such as

project = br and resolved >-60d and resolution is not empty 

noting that by default at most 1000 issues will be listed, so you'll want to limit the search as much as you can (e.g. limit to a particular project, resolved within the last xx days, etc.)

and display the Created and Resolved columns.

Then export to CSV the Current Fields. Open with Excel and add a column like

=IF(INT(F2)=INT(H2),1,0)

where F and H are your columns with the Created and Resolved dates. You may need to set the data type of the new column to Number. You can then sort your data by that column; all the 1's (created and resolved the same day) will be grouped together.

0 votes
Pete Singleton
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.
February 21, 2020

There's quite a few apps for Jira that extend JQL functionality.  This one looks like it does what you need:

https://marketplace.atlassian.com/apps/1216859/jql-search-toolkit

0 votes
Payne
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.
February 20, 2020

You don't state your environment (server or cloud), but if you're running server and have access to the database, the following SQL query will give you the data you seek:

select * from jiraissue where date(CREATED) = date(RESOLUTIONDATE)

0 votes
Pete Singleton
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.
February 20, 2020

Unfortunately JQL doesn't have the ability to compare two date fields directly, so you can't for example query on "resolved >= created".  You can only compare each field to fixed values or functions like "now()" or "startOfDay".

So to achieve this (without a plugin) you would have to run the query for each date you want to check.

javier_gallego_ezpeleta February 20, 2020

Thanks Pete, but I need to extract all the issues that accomplish these condition in the whole year and use now() for 365 days is not an option.

 

Thank you anyway.

 

Att,

Suggest an answer

Log in or Sign up to answer