CycleTime calculation
General process
Section titled General processRemark
Section titled RemarkWhen we calculate the relevant card data, we round each number after obtaining the data, following the method of rounding down for numbers below .5 and rounding up for numbers .5 and above. These values are then added together. This approach differs from adding the values first and then rounding, and is done to maintain the accuracy of the precision.
Undone card
Section titled Undone cardDefinition
Section titled Definition- In current open sprint and status not in real done status.
example:
Real done columns: ‘Testing’ and ‘Done’
- card A in ‘In Dev’ column
- card B in ‘Review’ column
- card C in ‘Testing’ column
Result: card A and B are undone cards
Flow chart
Section titled Flow chartJQL to get undone cards
Section titled JQL to get undone cardsprivate JiraCardWithFields getAllNonDoneCardsForActiveSprint(URI baseUrl, List<String> status, BoardRequestParam boardRequestParam) {
String jql;
if (status.isEmpty()) {
jql = "sprint in openSprints() ";
}
else {
jql = "sprint in openSprints() AND status not in ('" + String.join("','", status) + "')";
}
return getCardList(baseUrl, boardRequestParam, jql, "nonDone");
}
Done card
Section titled Done cardDefinition
Section titled Definition- The earliest time move to real done column is in the date range user selected
example:
selected date range: 2023.8.7 ~ 2023.8.20
Real done columns: ‘Testing’ and ‘Done’
- card A moved to ‘Testing’ column in 2023.8.6 and moved ‘Done’ column in 2023.8.9
- card B moved to ‘Testing’ column in 2023.8.8 and moved ‘Done’ column in 2023.8.10
- card C moved to ‘Testing’ column in 2023.8.15
- card D moved to ‘Testing’ column in 2023.8.21
Result: card B and C are done cards
Flow chart
Section titled Flow chartJQL to get done cards
Section titled JQL to get done cardsprivate String parseJiraJql(BoardType boardType, List<String> doneColumns, BoardRequestParam boardRequestParam) {
if (boardType == BoardType.JIRA) {
return String.format("status in ('%s') AND status changed during (%s, %s)", String.join("','", doneColumns),
boardRequestParam.getStartTime(), boardRequestParam.getEndTime());
}
else {
StringBuilder subJql = new StringBuilder();
for (int index = 0; index < doneColumns.size() - 1; index++) {
subJql.append(String.format("status changed to '%s' during (%s, %s) or ", doneColumns.get(index),
boardRequestParam.getStartTime(), boardRequestParam.getEndTime()));
}
subJql
.append(String.format("status changed to '%s' during (%s, %s)", doneColumns.get(doneColumns.size() - 1),
boardRequestParam.getStartTime(), boardRequestParam.getEndTime()));
return String.format("status in ('%s') AND (%s)", String.join("', '", doneColumns), subJql);
}
}
Filter done card belonged to selected date range
Section titled Filter done card belonged to selected date range- Get done card histories;
- Filter histories about status changed;
- Filter status changed to real done statuses;
- Get the timestamps moved to real done statuses;
- Compare timestamps with selected date range to check whether it belongs to this range;
OriginCycleTime implementation of export board data
Section titled OriginCycleTime implementation of export board data- flag: OriginCycleTime:
FLAG
- block: OriginCycleTime:
BLOCK
- ---green line---:
Block days
when Set Consider the “Flag” as “Block” isFalse
- ---purple line---:
Block days
when Set Consider the “Flag” as “Block” isTrue
- ⚠️ When calculating the time for the non-realdone column, subtract the flag duration if this column is flagged and Consider the “Flag” as “Block” is True
Scenarios
Section titled ScenariosNumber | Description | Timeline diagram | Block Days (Consider the “Flag” as “Block” is True ) | Block Days (Consider the “Flag” as “Block” is False ) |
---|---|---|---|---|
1 | Move to Block column after flag duration | ![]() | Time between Add flag and Remove flag + Time in block column | Time in block column |
2 | Move out Block column before flag duration | ![]() | Time between Add flag and Remove flag + Time in block column | Time in block column |
3 | Block column duration within flag duration | ![]() | Time between Add flag and Remove flag | Time in block column |
4 | Flag duration within Block duration | ![]() | Time in block column | Time in block column |
5 | Block duration partial cross flag duration and block start time before flag start time | ![]() | Time between Add flag and Remove flag + Time in block column - Overlap time | Time in block column |
6 | Block duration partial cross flag duration and block end time after flag end time | ![]() | Time between Add flag and Remove flag + Time in block column - Overlap time | Time in block column |
7 | Flag duration partial cross realDone duration | ![]() | Time between Add flag and Remove flag + Time in block column - flag and block cross time - flag and done cross time | Time in block column |