The following topic describes how to create an e-mail notification rule.
Enabling notification to the All filter for a certain bug or task is similar to using the "watch" mode in some systems, i.e. a user will get e-mail notifications whenever there is a change in the task status, or any messages are added.
To get e-mail notifications both when a new task is added and when some other user (not him/herself) adds a message, use the following filter:
Section |
Column |
Condition |
Message Parameters |
Submitter |
is not Current User |
To get e-mail notifications only if you are the handle of the task, use the filter:
Section |
Column |
Condition |
Task Parameters |
Handler |
is Current User |
To get e-mail notifications both when a high-priority task is added and when John Smith adds a message to the task:
Section |
Column |
Condition |
Task Parameters |
Priority |
High |
Message Parameters |
Submitter |
John Smith |
To get e-mail notifications when other users add a message to the task for which the handler is the subscribed user:
Section |
Column |
Condition |
Task Parameters |
Handler |
is Current User |
Message Parameters |
Submitter |
is not Current User |
To get the time difference (in seconds) between two consecutive messages:
ArrayList messages = task.getMessages(); Collections.reverse(messages); java.util.Date oldDate = task.getSubmitdate().getTime(); long diff = 0; for(Iterator it = messages.iterator();it.hasNext();) { java.util.Date newDate = ((Calendar)it.next()).getTime(); diff = newDate.getTime() - oldDate.getTime(); oldDate = newDate; } return diff/1000;