Automation Series: Auto-update Project End Date When a Task is Rescheduled

Automation Series: Auto-update Project End Date When a Task is Rescheduled

When a project is planned, tasks are scheduled within the projects timeline. Any delay in the predecessor tasks can delay dependent tasks, which can in turn impact the project timeline. Unless the project is manually rescheduled, the end date might not align with the task time line. This leads to discrepancies in the project. With this automation, the project roadmap stays aligned with the task's due date while also notifying the owner in case of any changes to the schedule.

Let's consider an event management firm coordinating an Award Ceremony. Here multiple tasks can depend on the outcome of a single task for before they progress. For example, tasks such as Trophy Engraving and Certificate Printing are dependent on the Nominee Confirmation task. When the jury takes time to confirm the nominee, the dependent tasks linked are postponed as well.

As the delays cascade, the final task ends up exceeding the project end date. With this automation, the project end date is updated automatically and the project owner receives an email notification. This ensures task and project due dates stay accurate even when task timeline shifts, eliminating the need for manual rescheduling.
Notes
This automation applies to both manual task date updates and dependency-based shifts.
To configure this flow in your Zoho Projects portal,

      1. Navigate to the upper-right corner of the page and click  → Developer Space → Connections.
      2. Click Create Connection, choose Zoho Projects as the service, and add the following scope:
  1. ZohoProjects.projects.UPDATE

Connection

      3. Navigate to Custom Functions under Developer Space.
      4. Click the Tasks tab in the top panel.
      5. Click on Create a new custom function and add the below Deluge script.
Notes
Ensure that the portal URL aligns with your data centre. If not, the function may not execute as expected.
  1. // scopes: ZohoProjects.projects.UPDATE
  2. endPoint = "https://projectsapi.zoho.in/api/v3/portal/";
  3. format = "dd-MM-yyyy";
  4. params = Map();
  5. if(taskDueDate != null && projectEndDate != null)
  6. {
  7. daysDiff = daysBetween(toDate(toString(taskDueDate,format)),toDate(toString(projectEndDate,format)));
  8. if(daysDiff < 0){
  9. params.put("end_date",toString(taskDueDate,"yyyy-MM-dd"));
  10. updateProjectResponse = invokeurl
  11. [
  12. url :endPoint + portalId + "/projects/" + projectId
  13. type :PATCH
  14. parameters:params.toString()
  15. connection:"projectdateupdate"
  16. ];
  17. sendmail
  18. [
  19. from :zoho.adminuserid
  20. to :projectOwner.get(0).get("email")
  21. subject :"Project End Date update in Zoho Projects!"
  22. message :"Hi, the " + projectName + " project end date has been updated to " + toString(taskDueDate,format)
  23. ]
  24. }
  25. }
  26. return "success";
Info
  1. Line 2: Replace the domain like AU, EU, CN, IN etc.in the URL to match your data centre.
  2. Line 13: Replace "projectdateupdate" with your Zoho Projects connection name.
      6. Add the following arguments during configuration.
      7. Click Save.
      8. Navigate to   → Automation → Workflow Rules.
      9. Click the Tasks tab in the top panel and click New Workflow Rule.

Workflow

    10. Select Based on User Action as the execution condition and execute the rule when a Task is Updated. Select Due Date from the dropdown.
    11. Click +Add Action and select Associate Custom Function. Select the custom function created previously.
    12. Click Save Rule.
    13. Toggle the Workflow Rule Status on to enable it.

Execution

If you have any questions, feel free to drop a comment below or reach out to us at support@zohoprojects.com.