private void fillSprintBacklog(ContextBuilder context) { Sprint sprint = project.getCurrentSprint(); context.put("label", sprint.getLabel()); context.put("goal", wiki2html(sprint.getGoal())); context.put("begin", sprint.getBegin().toString(Date.FORMAT_LONGMONTH_DAY_YEAR)); context.put("end", sprint.getEnd().toString(Date.FORMAT_LONGMONTH_DAY_YEAR)); Release release = sprint.getRelease(); if (release != null) context.put("release", release.getLabel()); List<Requirement> requirements = new ArrayList<Requirement>(sprint.getRequirements()); Collections.sort(requirements, project.getRequirementsOrderComparator()); for (Requirement requirement : requirements) { fillStory(context.addSubContext("stories"), requirement); } }
public void switchToNextSprint() { Sprint oldSprint = getCurrentSprint(); oldSprint.close(); oldSprint.setEnd(Date.today()); getCurrentSprintSnapshot().update(); Sprint newSprint = getNextSprint(); if (newSprint == null) newSprint = createNextSprint(); if (!newSprint.isBeginSet() || newSprint.getBegin().isPast()) newSprint.setBegin(Date.today()); if (!newSprint.isEndSet() || newSprint.getEnd().isBeforeOrSame(newSprint.getBegin())) newSprint.setEnd(newSprint.getBegin().addDays(oldSprint.getLengthInDays())); setCurrentSprint(newSprint); createNextSprint(); createSprintSnapshot(); for (Task task : oldSprint.getTasks()) { if (task.isClosed()) { taskDao.deleteEntity(task); } } }