Forums

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

How to filter Issues based on two dates

Musku Nagaraju
Contributor
October 23, 2018

Hi Team,

I am using JIRA cloud,

I have one JIRA custom field called "Start Date", While creating issues we are selecting this date and when we are closed tickets the Resolved date has been crated automatically with current date.

As per my project rule we need Resolve issue with in 5 days of "start date"

 Ex: If I select start date 01/oct/2018 we need to resolve issue before 5/oct/2018. but some tickets not closed with 5 days, I need to filter issues which is not closed with in 5 days.

Screen shot:

Start date.PNG

Please have a look above screen shot, 

COX-2010 start Date and Resolved date same so I no need to filter this issue

COX-1874 this issue closed in 21 days so I need to filter this issue

COX-2033 it was closed in 1 days so I no need this

Compare to Start date which issue resolved after 5 days I need to filter that issues

Could you please help me the JQL query to filter those tickets

 

 

 

2 answers

1 vote
Deleted user October 23, 2018

Hi @Musku Nagaraju

I wouldn't think this can be achieved with a plain JQL that you would write. We cannot use operators around the JQL to do the comparison to realize the requirement you brought in.

The way you could try to accomplish this is by having a new (calculated) custom field, possibly sitting on your Resolution screen that automatically calculates the diff between Resolution and Created Dates and populates this new custom field when we are ready to move ahead with issue resolution. However, since the ResolutionDate is empty while we are still on the transition screen for Resolution, we may want to calculate it with the current Date (instead of ResolutionDate).

Once we have this custom field available, we could quickly put a JQL together by using a filter, as required, and pull the result set. 

Note: This will work only if you are running the report on the issues that stand Resolved.

If you are open to using Plug-ins from the MarketPlace, I am sure there are some that can help you. To name one that came in from some of the earlier posts, in this context is - https://marketplace.atlassian.com/apps/27136/jira-misc-custom-fields?hosting=server&tab=overview

 

Hope this helps!

Thanks

Kalyani

Musku Nagaraju
Contributor
October 23, 2018

HI Kalyani

Thanks for your reply...

I have checked that plug-in it was good, but the same available in server

I am using JIRA cloud ..

 

Thanks

Nagaraju 

0 votes
Daniel Deng
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.
October 23, 2018

Hi Musku

Agree with @[deleted]

Another plugin recommendation is https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?hosting=cloud&tab=overview

Create a script field with inline code like

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import java.util.Date.*

Date created = issue.getCreated()
Date resolved = issue.getResolutionDate()

return resolved - created

Musku Nagaraju
Contributor
October 23, 2018

Hi Daniel,

Thanks for your reply, I will look into this 

Thanks

Nagaraju

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events