Automation Series: Close all tasks once the project is completed

Automation Series: Close all tasks once the project is completed

When a project is marked as Completed, it might still have open tasks such as recurring tasks that were not marked as complete, tasks that are no longer relevant, or tasks that no longer need attention after closure.

To ensure the project reflects its final state, you can use a task workflow rule to automatically close all open tasks once the project reaches the Completed status.

To set this up,

First create a connection with Zoho Projects using these scopes:
  1. ZohoProjects.tasks.ALL
  2. ZohoProjects.projects.READ
  3. ZohoProjects.portals.READ
  4. ZohoProjects.milestones.ALL
Create a Custom Function and add the Deluge script below. Replace 'xxxxxxxxx' with your Zoho Projects connection name, and map the arguments listed below.

The below script removes task recurrences and closes all tasks in a project. In the below script, the connection name is "closealltasks"

  1. // TODO: Please create a connection for the Zoho Projects service with the scopes "ZohoProjects.tasks.ALL,  ZohoProjects.projects.READ,  ZohoProjects.portals.READ, ZohoProjects.milestones.ALL". Replace 'closealltasks' with the connection name. Click this link below to learn how to create the connection. 
  2. // Link - https://help.zoho.com/portal/en/kb/projects/integration/connections/articles/connections-23-5-2022#How_to_establish_a_Connection
  3. // TODO: Replace the status name (Closed status type) in Line No. 6, if needed.
  4. projectsAPIEndPoint = "https://projectsapi.zoho.com/restapi";
  5. projectsv3APIEndPoint = "https://projectsapi.zoho.com/api/v3";
  6. statusName = "Closed";
  7. statusId = null;
  8. /*  Close all tasks */
  9. //Fetch task layouts
  10. taskLayoutDetails = invokeurl
  11. [
  12. url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasklayouts"
  13. type :GET
  14. connection:"closealltasks"
  15. ];
  16. // info taskLayoutDetails;
  17. if(taskLayoutDetails != null && taskLayoutDetails.get("status_details") != null)
  18. {
  19. statusDetails = taskLayoutDetails.get("status_details");
  20. for each  status in statusDetails
  21. {
  22. if(status.get("name").equalsIgnoreCase(statusName))
  23. {
  24. // Fetch task status id based on status name
  25. statusId = status.get("id");
  26. info status.get("name") + " : " + statusId;
  27. break;
  28. }
  29. }
  30. }
  31. if(statusId != null)
  32. {
  33. indexValue = 1;
  34. rangeValue = 100;
  35. loop = {1,2,3,4,5,6,7,8,9,10};
  36. predStatusMap = Map();
  37. // This loop fetches up to 300 tasks. Increase the count as needed, e.g., loop = {1,2,3,4,5}; to fetch 500 tasks.
  38. for each  i in loop
  39. {
  40. taskParameter = Map();
  41. taskParameter.put("index",indexValue);
  42. taskParameter.put("range",rangeValue);
  43. taskParameter.put("status","notcompleted");
  44. //  info taskParameter;
  45. taskResponse = zoho.projects.getRecords(portalId,projectId,"tasks",taskParameter,0,"closealltasks");
  46. //  info taskResponse;
  47. if(taskResponse.containKey("tasks"))
  48. {
  49. taskIds = list();
  50. for each  task in taskResponse.get("tasks")
  51. {
  52. taskId = task.get("id");
  53. if(task.get("is_recurrence_set"))
  54. {
  55. updateTaskParameter = Map();
  56. updateTaskParameter.put("json_string",{"recurrence":{"recurring_frequency":"none","time_span":"1","number_of_occurrences":"2","is_comments_recurred":false,"recurrence_type":"after_current_task_completed"}});
  57. updateTaskResponse = zoho.projects.update(portalId,projectId,"tasks",taskId,updateTaskParameter,"closealltasks");
  58. info updateTaskResponse;
  59. }
  60. if(task.containsKey("dependency") && task.get("dependency").containsKey("predecessor"))
  61. {
  62. predTasks = task.get("dependency").get("predecessor");
  63. predList = list();
  64. for each  predTaskId in predTasks
  65. {
  66. predList.add(task.get("dependency").get("dependencyDetails").get(predTaskId).get("IS_COMPLETED"));
  67. }
  68. if(!predList.contains(false))
  69. {
  70. taskIds.add(taskId);
  71. }
  72. }
  73. else
  74. {
  75. taskIds.add(taskId);
  76. }
  77. info "taskIds : " + taskIds;
  78. }
  79. bulkUpdateParams = Map();
  80. bulkUpdateParams.put("taskids",taskIds.toText().remove("[").remove("]"));
  81. bulkUpdateParams.put("status",{"id":statusId});
  82. info bulkUpdateParams;
  83. /* Bulk update */
  84. taskBulkUpdate = invokeurl
  85. [
  86. url :projectsv3APIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/bulk-update"
  87. type :PATCH
  88. parameters:bulkUpdateParams.toString()
  89. connection:"closealltasks"
  90. ];
  91. info taskBulkUpdate;
  92. }
  93. else
  94. {
  95. break;
  96. }
  97. }
  98. }
  99. return "success";

Argument Mapping:
  1. portalId - Portal System ID
  2. projectId - Project System ID

After saving the custom function, create a workflow rule with the following settings:



Once the rule is saved, all open tasks are completed automatically whenever a project is marked as Completed. This ensures the project reflects its true closure state, avoids manual cleanup and keeps your project up to date.

If you have any questions, please drop comments below or email us at support@zohoprojects.com.



      • Sticky Posts

      • Time Log Reminder

        Tracking the time spent on tasks and issues is one of the most important functions of a timesheet. However, users may forget to update the time logs because they have their own goals to achieve. But, time logs must be updated at regular intervals to keep
      • Introducing the Zoho Projects Learning Space

        Every product has its learning curve, and sometimes having a guided path makes the learning experience smoother. With that goal, we introduce a dedicated learning space for Zoho Projects, a platform where you can explore lessons, learn at your own pace,
      • Update on V2 API End-of-Life Timeline

        Dear Users, Earlier this year, we shared the launch of the V3 APIs and requested users to migrate from the older V2 APIs by December 2025. We have received valuable feedback from our users and partners regarding their migration timelines. We are happy
      • Automation Series: Auto-update Phase Status

        Hello Folks! You can auto-update your phase's status based on status of underlying tasks using custom functions. In this series, we will showcase how to create and run custom functions, using Deluge, with ease. Follow the steps below and automate your
      • Automate Timesheet Approvals with Multi-level Approval Rules

        Introducing Approval Rules for Timesheets in Zoho Projects. With this automation, teams can manage how timesheets are reviewed and approved by setting up rules with criteria and assigning approvers to handle submissions. Timesheet, when associated to

        • Recent Topics

        • Track online, in-office, and client location meetings separately with the new meeting venue option

          Hello everyone! We’re excited to announce meeting enhancements in Zoho CRM that bring more clarity and structure to how meetings are categorized. You can now specify the meeting venue to clearly indicate whether a meeting is being held online, at the
        • Announcing new features in Trident for Mac (1.32.0)

          Hello everyone! We’re excited to introduce the latest updates to Trident, which are designed to reinforce email security and protect your inbox from evolving threats. Let’s take a quick look at what’s new. Deliver quarantined emails. Organization admins
        • Marketing Tip #5: Improve store speed with optimized images

          Slow-loading websites can turn visitors away. One of the biggest culprits? Large, uncompressed images. By optimizing your images, your store loads faster and creates a smoother shopping experience leading to higher sales. It also indirectly improves SEO.
        • SMS to customers from within Bigin

          Hi All, Is there anyone else crying out for Bigin SMS capability to send an SMS to customers directly from the Bigin interface? We have inbuilt telephony already with call recordings which works well. What's lacking is the ability to send and receive
        • Admins cannot see each others' Scheduled Reports?!

          Very frustrating that as an admin I cannot see what my reports my fellow admins have created and scheduled.  After asking about this on the help chat, I was told the issue is trust and security.  By giving someone Admin status, it means we trust them with those responsibilities. Please change this, it is not a good process to have to bother other users to change a report or change users within a report.
        • Writer update results in BitDefender blocking it as malware

          After updating Writer to latest update, Bitdefender blocked the app and writer no longer runs.
        • Missing Import Options

          Hello, do I miss something or is there no space import option inside of this application? In ClickUp, you can import from every common application. We don't want to go through every page and export them one by one. That wastes time. We want to centralize
        • Zoho CRM Portal Field Level Permission Issue

          Hi Support Team, I am using the Zoho CRM Portal and configuring field-level editing permissions. However, we are unable to restrict portal users from editing certain fields. We have created a portal and provided View and Edit (Shared Only) access for
        • Custom Fonts in Zoho CRM Template Builder

          Hi, I am currently creating a new template for our quotes using the Zoho CRM template builder. However, I noticed that there is no option to add custom fonts to the template builder. It would greatly enhance the flexibility and branding capabilities if
        • Collaboration with customers made easy with Zoom Meeting and Zoho Desk integration

          Hello everyone! We are happy to announce that you can now integrate your Zoho Desk account with Zoom Meeting. The integration bridges the gap between digital communication and human connection, empowering teams to deliver timely support when it matters
        • CRM Canvas - Upload Attachments

          I am in the process of changing my screens to Canvas.  On one screen, I have tabs with related lists, one of which is attachments.  There doesn't appear to be a way to upload documents though.  Am I missing something really obvious?  Does anyone have
        • TrueSync regularly filling up my local disk

          Seems that WorkDrive's TrueSync randomly starts filling up my local hard drive space. None of the folders have been set as "Make Offline" but still it seems to randomly start making file offline. The settings of the app is so minimal and is of no real
        • Kaizen #194 : Trigger Client Script via Custom buttons

          Hello everyone! Welcome back to another interesting and useful Kaizen post. We know that Client Scripts can be triggered with Canvas buttons and we discussed this with a use case in Kaizen#180. Today, let us discuss how to trigger Client Script when a
        • [Webinar] A recap of Zoho Writer in 2025

          Hi Zoho Writer users, We're excited to announce Zoho Writer's webinar for January 2026: A recap of Zoho Writer in 2025. This webinar will provide a recap of the features and enhancements we added in 2025 to enhance your productivity. Choose your preferred
        • Picklist field shows "none" as default

          Hello, Is there an option to avoid showing "none" as the default value in a picklist field? I also don't want to see any option displayed. My expectation is to have a blank bar, and then when I display the drop-down list, I can choose whichever I wa
        • Stage-probability mapping feature in custom module

          Hi, I'm building a custom module for manage projects. I would like to implement the stage-probability feature that Potentials has. Is this possible?
        • Field Description is very small

          Hello, The field Description in the activity is very small. Why don't try open a new window, or a bigger popup, or increase the width of the "popup". Example:
        • StatusIQ

          Please add StatusIQ to data sources. We using site24x7 and StatusIQ together and site24x7 integration is already there. Thanks and regards, Torsten
        • In Zoho People, the Operations buttons are frequently not visible or do not appear consistently.

          In Zoho People, the Operations buttons are frequently not visible or do not appear consistently. We request you to please investigate and address this issue, as it is affecting daily HR operations and user access.
        • Marketing Tip #14: Increase cart value with product bundles

          Bundling products is a great way to increase average order value while giving customers more convenience. Think “camera + tripod + memory card” or “soap + lotion + bath salts.” Bundles make shopping easier and feel like a better deal. It’s a win-win for
        • Problem with Workdrive folders

          I'm having a problem a problem accessing files in a Zoho work drive folder when using the Zoho writer app. The problem folder appears grayed out in the Zoho work drive window in both the online and writer application. However I can open the folder in
        • Add RTL and Hebrew Support for Candidate Portal (and Other Zoho Recruit Portals)

          Dear Zoho Recruit Team, I hope you're doing well. We would like to request the ability to set the Candidate Portal to be Right-to-Left (RTL) and in Hebrew, similar to the existing functionality for the Career Site. Currently, when we set the Career Site
        • Pre-orders at Zoho Commerce

          We plan to have regular producs that are avaliable for purchase now and we plan to have products that will be avaliable in 2-4 weeks. How we can take the pre-orders for these products? We need to take the money for the product now, but the delivery will
        • Zoho Books' 2025 Wrapped

          Before we turn the page to a new year, it’s time to revisit the updates that made financial management simpler and more intuitive. This annual roundup brings together the most impactful features and enhancements we delivered in 2025, offering a clear
        • Can multiple agents be assigned to one ticket on purpose?

          Is it possible to assign one ticket to two or more agents at a time? I would like the option to have multiple people working on one ticket so that the same ticket is viewable for those agents on their list of pending tickets. Is something like this currently
        • Edit default "We are here to help you" text in chat SalesIQ widget

          Does anyone know how this text can be edited? I can't find it anywhere in settings. Thanks!
        • Can't change form's original name in URL

          Hi all, I have been duplicating + editing forms for jobs regarding the same department to maintain formatting + styling. The issue I've not run into is because I've duplicated it from an existing form, the URL doesn't seem to want to update with the new
        • Feature Request: Sync Leave Tracker to Zoho Mail / Calendar or provide option to download information

          Zoho Leave Tracker offers the option to sync the leave Calendar to Microsoft 365 and Google Calendar. Adding an option to sync to Zoho-Mail Calendar would avoid duplication and add significant value for users. An alternative would be to allow users to
        • Compensation | Salary Packages - Hourly Wage Needed

          The US Bureau of Labor Statistics says 55.7% of all workers in the US are paid by the hour. I don't know how that compares to the rest of the world, but I would think that this alone would justify the need for having an hourly-based salary package option.
        • Multiple currencies - doesn’t seem to work for site visitors / customers

          I am trying to understand how the multiple currency feature works from the perspective of the website visitor who is shopping on my Zoho Commerce site. My site’s base currency is US Dollars (USD) but my store is for customers in Costa Rica and I would
        • Archiving Contacts

          How do I archive a list of contacts, or individual contacts?
        • How do people handle using Outlook and Zoho Project calendar at the same time?

          We have an ongoing problem in our organisation where we use Zoho Projects to plan all of our projects tasks and that also allows us to look forward using the workload report to see which of our consultants are overstretched etc and which are available.
        • 10GB Email Storage Limits in Zoho CRM

          We’ve had Zoho One for almost 5 years and have always synced our emails from Gmail via IMAP… As of late, we’ve run into issues with our emails not syncing, due to being over the 10GB storage cap… What’s very odd is that we haven’t changed a thing? I know
        • Performance is degrading

          We have used Mail and Cliq for about three years now. I used to use both on the browser. Both have, over the past 6 months, had a severe degradation in performance. I switched to desktop email, which appeared to improve things somewhat, although initial
        • How to set page defaults in zoho writer?

          hi, everytime i open the zoho writer i have to change the default page settings to - A4 from letter, margins to narrow and header and footer to 0. I cannot set this as default as that option is grayed out! so I am unable to click it. I saved the document
        • Unable to Send Different Email Templates for Different Documents in Zoho Sign

          Hello Zoho Community, I am facing a limitation with Zoho Sign regarding email notifications sent to customers when a document is sent for signing. Currently, whenever I send any template/document for signing, the email notification that goes to the customer
        • Enable History Tracking for Picklist Values Not Available

          When I create a custom picklist field in Deals, the "Enable History Tracking for Picklist Values" option is not available in the Edit Properties area of the picklist. When I create a picklist in any other Module, that option is available. Is there a specific reason why this isn't available for fields in the Deals Module?
        • Vault crashes on Android Devices

          Vault is continuously closing after entering the master password on my Android device. After several attempts I get a system message that says there is a bug in the app. I've uninstalled and reinstalled the app, and cleared the app cache, but nothing
        • ¿Cómo puedo configurar las contraseñas creadas bajo una directiva para que nunca caduquen y no aparezcan como caducadas en los informes?

          ¿Cómo puedo configurar las contraseñas creadas bajo una directiva para que nunca caduquen y no aparezcan como caducadas en los informes? La razón por la cual contraseña estas no deben caducar es porque su actualización depende de mi cliente y no de mí.
        • Camera access

          My picture doesn't appear in a group discussion. (The audio is fine.) The guide says "Click the lock icon on address bar," but I can't find it. Advise, please
        • Next Page