Helper Objects in todo4teams
To simplify the creation of scripts, several auxiliary objects are placed within the context of the executed scripts. All scripts contain the following auxialary objects:
- helper: the central object with tons of functions to simplify your life
- task: the current ticket in your context
- result: a string controlling the success or failure of the execution. A successful script execution should be marked with „success“ a failure with „failure“.
- logger: an object to trace script execution log messages
There are additional objects
For the receive action of a mailbox
- message: the incoming email
- coretext:the extracted text of an incoming email
For the Receive Action of an sms-box
- sms: the incoming sms
For the Finish-Action of forms:
- form: the current form
- data: an associative array containing filedname and field of the form
- allForms: an associative array containing formname and form of the current job
For the Start Action of groups
- taskForms: all forms attached to the current task
- allForms: all available forms
For the Finish Action of groups:
- taskForms: all forms attached to the current task
- allForms: all available forms
You can access functions and attributes of these auxiliary objects by means of the point notation. E.g. you can access the description of the current task in order to print it to the screen this way:
println(task.getDescription());
or you can set the owner of the current task to the name of the user with the name tmiller:
helper.setOwnerByName("tmiller")
or you can search the text of an incoming SMS for the word „Profi“
println("SMS contains keyword Profi:" + sms.smsText.contains("Profi"));
or you can access the value of the textfield with the name "Textfield_1" in order to print it:
println(form.get("Textfield_1").value);
In the following chapters the progamming interfaces of these auxiliary objects are discussed in detail.