Mandatory addressing of forms
You have created a form in todo4teams, but want this form to be used for tickets to a specific team exclusively?
In other words, when using this form, a very specific team must be selected when addressing the ticket.
To do this, proceed as follows:
- Select “Forms” in the main menu.
- Select the form for which you want to make addressing mandatory.
- Switch to the "Scripts" tab and select the "Send Action" tab, and paste the following script code into the text field:
var adressee=null;
if(task.getAddressee()!=null && task.getAddressee().getAddressedWorkgroup()!=null){
adressee=task.getAddressee().getAddressedWorkgroup().getName();
}
if(adressee!="Team West"){
helper.errorMessage("This form may only be addressed to Team West.");
result="error";
}
This example requires the form to be addressed to the team “Team West”. Change the team name according to your needs.
If the addressee of the ticket is not "Team West" when it is sent, an error message is displayed with the method "helper.errorMessage()" and the ticket is prevented from being sent by setting the result variable result="error".
The user can then either set the desired addressee or deactivate this form to send the ticket.