CycleTime calculation

When 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.

  • 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

private 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");
}

  • 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

private 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
  1. Get done card histories;
  2. Filter histories about status changed;
  3. Filter status changed to real done statuses;
  4. Get the timestamps moved to real done statuses;
  5. 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” is False
  • ---purple line---: Block days when Set Consider the “Flag” as “Block” is True
  • ⚠️ 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
NumberDescriptionTimeline diagramBlock Days (Consider the “Flag” as “Block” is True)Block Days (Consider the “Flag” as “Block” is False)
1Move to Block column after flag durationimg1.pngTime between Add flag and Remove flag + Time in block columnTime in block column
2Move out Block column before flag durationimg2.pngTime between Add flag and Remove flag + Time in block columnTime in block column
3Block column duration within flag durationimg3.pngTime between Add flag and Remove flagTime in block column
4Flag duration within Block durationimg4.pngTime in block columnTime in block column
5Block duration partial cross flag duration and block start time before flag start timeimg5.pngTime between Add flag and Remove flag + Time in block column - Overlap timeTime in block column
6Block duration partial cross flag duration and block end time after flag end timeimg6.pngTime between Add flag and Remove flag + Time in block column - Overlap timeTime in block column
7Flag duration partial cross realDone durationimg7.pngTime between Add flag and Remove flag + Time in block column - flag and block cross time - flag and done cross timeTime in block column