TrackStudio Enterprise 3.1
Example 6

Use the e-mail notification rule based on the following script to send an e-mail notification only when the user adds a message and not when the user modifies task properties. The following script will return 1 when the task has been modified by adding a message, or 0 when the task has been modified using Task->Edit.

int ret = 0;

Collection messages = task.getMessages();
java.sql.Timestamp taskDate = task.getUpdatedate();

for(Iterator it = messages.iterator(); it.hasNext();) {
    java.sql.Timestamp date = it.next().getTime();
    if (date.equals(taskDate)) {
       ret=1;
       break;
    }
}
return ret;
Copyright (c) 2002-2005. All rights reserved.