JIRA Filter

I want to create a filter which results the issues closed in < some X days.

 

Example:  Issues which are closed within X days....using Created Date and Closing date of issue.

I want like this in filter... (Closing Date - CreatedDate) <= X Days

5 answers

This widget could not be displayed.
Zack Seibert Community Champion Mar 15, 2016

If you have JIRA Service Desk, you could set this up using SLAs that trigger on Issue Created and Issue Resolved. If you would set the SLA to 5 days for example, the SLA would be breached for any days where it look more than 5 days to go from Created to Resolved.

 

Unfortunately, I don't think there is a way to do this with just JQL.

This widget could not be displayed.

Hi Chary,

use this:

status changed to Closed after -7d

It shows all issues which were closed within last 7 days

This widget could not be displayed.
Vasiliy Zverev Community Champion Mar 15, 2016

I use script field provided by ScriptRunner plugin to do such things. Here is cade for this one:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.fields.CustomField

import java.sql.Timestamp

return (int) ( issue.getCreated().getTime() - getMillsForCstFd("custom field name 1", issue))/(1000*60*60*24)

public long getMillsForCstFd(String _customFiledname, Issue _issue){
    CustomField customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName(_customFiledname);
    if(customField == null)
        return 0

    Timestamp cstFldDate = (Timestamp) _issue.getCustomFieldValue(customField);
    return (cstFldDate == null) ? 0 : cstFldDate.getTime();
}
This widget could not be displayed.

If you have scriptrunner available, it has a date compare function. You can do comparisons like: 

issueFunction in dateCompare("project = 'Information Testing'", "resolved &lt; created +15d")

This one returns any issue in the Information Testing project which was resolved within 15 days of being created.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

266 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you