Pomodoro Timer
This workflow supports the Pomodoro time management and time tracking technique. Pomodoro was created by Francesco Cirillo in the 1980s. For details, visit http://cirillocompany.de/pages/pomodoro-technique/.
File Name | jetbrains-youtrack-pomodoroTimer |
---|---|
Auto-attached | no |
Rules | Pomodoro states (state-machine) Pomodoro countdown (schedule) Don't change reason manually (stateless) |
- Enable and configure time tracking for your project.
- Add an enumerated field with the name Pomodoro state to your project. Add the values Timer's running, Not set, Timer finished, and On a break to the field.
- Add an enumerated field with the name Pomodoro interruption to your project. Add the values Boss interrupted, Facebook chat, Phone call, and Urgent email to the field.
- Add an integer-type field with the name Pomodoro countdown to your project.
- Attach the Pomodoro Timer workflow to your project.
Use Case
This workflow lets users follow the Pomodoro time management strategy. The Pomodoro technique works like this:
- Periods of activity are divided into equal intervals of time, which are called "pomodoros."
- A traditional pomodoro is 30 minutes long: 25 minutes of work plus a 5-minute break.
- Every four pomodoros, you are allowed to take a longer break of 15 to 30 minutes.
- A pomodoro cannot be interrupted or split up. It marks 25 minutes of pure work.
- If interruptions occur, you stop your pomodoro and log the cause of the interruption.
Rules
This workflow includes three rules.
Pomodoro states
The first rule defines how a pomodoro transitions from state to state. The beauty of this rule is that for each finished or interrupted pomodoro, YouTrack automatically adds a new work item. It automatically logs your work on a particular issue!
statemachine Pomodoro states for field Pomodoro state {
initial state Not set {
on start[always] do {
// The Pomodoro technique is a time management method created by Francesco Cirillo in the 1980s. For details visit http://www.pomodorotechnique.com/
} transit to Timer's running
}
state Timer's running {
enter {
Pomodoro interruption = null;
message(l10n ( 25 minutes pomodoro is started. ));
Pomodoro countdown = 25;
}
on interrupt [always] do {
Pomodoro interruption.required(l10n ( Please specify the interruption cause. ));
applyCommand("add work Today" + (25 - Pomodoro countdown) + "m" +
l10n ( Pomodoro was interrupted. The cause: ' ) + Pomodoro interruption.name + "'.");
Pomodoro countdown = null;
} transit to Not set
in 25 minutes[always] do {<define statements>} transit to Timer finished
}
state Timer finished {
on take a break[always] do {
message(l10n (5 minutes break. ));
applyCommand("add work Today 25m" + " +1 pomodoro.");
Pomodoro countdown = 5;
} transit to On a break
on discard[always] do {
Pomodoro interruption.required(l10n ( Please specify the interruption cause. ));
applyCommand("add work Today" + "25m" +
l10n ( Pomodoro was discarded. The cause: ' ) + Pomodoro interruption.name + "'.");
Pomodoro countdown = null;
} transit to Not set
}
state On a break {
on start[always] do {
applyCommand("add work Today" + (5 - Pomodoro countdown) + "m" + l10n ( +1 short break. ));
} transit to Timer's running
in 5 minutes[always] do {
applyCommand("add work Today 5m " + l10n( +1 break. ));
} transit to Not set
}
}
Pomodoro countdown
The second rule runs the timer and invokes a 25-minute countdown.
schedule rule Pomodoro countdown
every minute [Pomodoro countdown !=null && Pomodoro countdown !=0] {
//The Pomodoro technique is a time management method created by Francesco Cirillo in the 1980s. For details visit http://www.pomodorotechnique.com/
if (Pomodoro state == {Timer's running} || Pomodoro state == {On a break}) {
Pomodoro countdown = Pomodoro countdown - 1;
}
}
Don't change reason manually
The last rule prevents the user from changing the cause of an interruption (by entering a value in the Pomodoro interruption field) without stopping the timer.
rule Don't change reason manually
when Pomodoro interruption.changed {
//The Pomodoro technique is a time management method created by Francesco Cirillo in the 1980s. For details visit http://www.pomodorotechnique.com/
var causes = Pomodoro interruption == {Boss interrupted} ||
Pomodoro interruption == {Facebook chat} ||
Pomodoro interruption == {Phone call} || Pomodoro interruption == {Urgent email};
assert Pomodoro state.changed: l10n ( Cannot change the interruption cause without changing the timer state. );
}