fires before the user updates a task
|the task id
|the new (updated) object of the task
//any custom logic here
While using the onBeforeTaskUpdate event, it is not always possible to get the object of the task before the task is completely updated. The event fires after the task object has been updated but before all changes have been applied. To get the task object before the changes are applied, you need to use the event handlers which are directly related to the changes of the task:
If the changes are made via API, you may get the task object before the code, which modifies the task, is executed. Check the example where you may modify a task in different ways (for instance, change the task dates):
After comparison, you will notice that the events, which fire right before you modify the task, return the old task object, while the onBeforeTaskUpdate event returns a new object of the task.