Script Scheduling
todo4teams allows the time-controlled execution of scripts to complete recurring tasks, such as
- the hourly check of the service level
- the monthly automatic creation of a report
- etc.
The actual task is defined by a script in the Javascript programming language. An Introduction to Javascript can be found here.
Setting up a script
Select "Script planning" in the main menu on the left. The list of planned scripts is displayed.
Activate the "Show inactive" checkbox at the top if you want to reactivate or change a previously deactivated script.
Select an existing script or create a new entry by clicking on "New script".
You will now see the dialog for configuring the script execution on the right:
In the "Name" field, enter a name for the script to be saved, e.g. "Check Service Level".
Cron Pattern - Execution rhythm
In the "Cron Pattern" field, enter the execution rhythm of the script. With the Cron format, countless variations of time patterns can be defined using simple text expressions.
It contains six or seven fields with values for the seconds, minutes, hours, days of the week, etc. of the execution:
Name | Required | Allowed values | Special characters |
---|---|---|---|
Second | yes | 0-59 | , - * / |
Minutes | yes | 0-59 | , - * / |
Hours | yes | 0-23 | , - * / |
Day of the month | yes | 1-31 | , - * ? / L W C |
Month | yes | 0-11 or JAN-DEC | , - * / |
Day of the week | yes | 1-7 or SUN-SAT | , - * ? / L C # |
Year | no | empty or 1970-2099 | , - * / |
The * symbol stands for "all" and the question mark for "not relevant" (for days of the week, if days of the month have been specified).
Use the slash "/" to specify intervals. For example, in the first field (second), 0/20 would mean "every 20 seconds, 0,20,40".
Expressions
Cron expressions can thus be as simple as * * * * ? * (for execution every second) or as complex as 0 0,15 14 ? JAN MON 2026 (every Monday in January 2026 at 2:00 PM and 2:15 PM).
If this seems complicated, don't worry! Here are customizable examples for all the typical cases:
Expression | Means |
---|---|
0 0 12 * * ? | Start daily at 12:00 PM |
0 15 10 ? * * | Start daily at 10:15 AM |
0 15 10 * * ? MON | Start on Mondays at 10:15 AM |
0 15 10 * * ? 2027 | Start daily at 10:15 AM in 2027 |
0 * 14 * * ? | Start every minute between 2:00 PM and 2:59 PM every day |
0 0/5 14 * * ? | Start every 5 minutes between 2:00 PM and 2:55 PM every day |
0 15 10 ? * MON-FRI | Start at 10:15 AM Monday to Friday |
0 15 10 ? * 6#3 | Start at 10:15 a.m. on the third Friday (6) of every month |
0 11 11 11 11 ? | Start on November 11th of every year at 11:11 a.m. |
Description
Enter a description here to document the process.
Active
The script will only be executed at the specified frequency if this checkbox is activated. Otherwise, execution will pause.
Script
Switch to the "Script" tab to enter the script to be executed.
To test the function of the scheduled script execution, simply enter println("Hello world!");.
To run this script every 10 seconds, use the cron expression
0/10 * * * * ? *
Now switch to the menu item "Script Logging" to check the execution. There, select the logging target "Scheduled script" and select the script you just created in the combo box.
There you can now see that your script correctly outputs "Hello world!" exactly every ten seconds: