Age of issuee in any 'Transitions'

Anil Kumar December 13, 2015

We need a dashboard/filter to understand what all issues was/are in any "Transitions" from more than said days.

Like- filter all issues that was in more "In-Progress" or in "Need More Info" or custom Transitions "waiting for Code review" for more than 5 days.

We are using JIRA Server installation - 6.4.11

Regards, Anil

2 answers

0 votes
Vasiliy Zverev
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.
December 13, 2015

More simple, but less accurate solution is use JQL statement "updated < -5d".

It will filter all issues updated more that 5 days before.

Troublems: if any issue param changes (assignee, duedate and etc) it will not show an issue.

0 votes
Vasiliy Zverev
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.
December 13, 2015

We are using this calculated field to find any issues which statuses chaged since 11 am of last friday.

And we have several filters that uses result of this calculated field.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.changehistory.ChangeHistory
import com.atlassian.jira.issue.changehistory.ChangeHistoryManager
import com.atlassian.jira.issue.history.ChangeItemBean

/**
 * Created by VZverev on 01.12.2015.
 */

Issue issue;

///Начальное значение для статуса
PreviousStatus prevStatus = new PreviousStatus(Calendar.getInstance().getTimeInMillis(), issue.getStatusObject().getName());
ChangeHistoryManager changeHistoryManager = ComponentAccessor.getChangeHistoryManager();

//Дата, с которой анализируем историю изменений
Calendar lastFriday = Calendar.getInstance();
lastFriday.add(Calendar.WEEK_OF_YEAR, -1);
lastFriday.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
lastFriday.set(Calendar.HOUR,11);
Date lastFridayDate = new Date(lastFriday.getTimeInMillis())

if(issue.getCreated().getTime() &gt; lastFriday.getTimeInMillis())
    return "новый запрос";

for(ChangeHistory changeHistory: changeHistoryManager.getChangeHistoriesSince(issue, lastFridayDate)) {
    for(ChangeItemBean changeItemBean: changeHistory.getChangeItemBeans())
        if(changeItemBean.getField().equals("status")) {
            prevStatus.setNewStatus(changeItemBean.getCreated().getTime(), changeItemBean.getFromString());
            break;
        }
}

return prevStatus.getStatus().equals(issue.getStatusObject().getName())?"не изменился": prevStatus.getStatus()

class PreviousStatus{
    private long dateInMills;
    private String value;

    public PreviousStatus(long _dateInMills, String _value){
        dateInMills = _dateInMills;
        value = _value;
    }

    public setNewStatus(long _dateInMills, String _value){
        if(_dateInMills &lt; dateInMills){
            dateInMills = _dateInMills;
            value = _value;
        }
    }

    public String getStatus(){return value}
}

Suggest an answer

Log in or Sign up to answer