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

        • Why Zoho Contracts Prefers Structured Approvals Over Ad-hoc Approvals

          Approvals are one of the most important stages in a contract’s lifecycle. They determine whether a contract moves forward, gets revised, or needs further discussion. The approval process also defines accountability within the organization. Zoho Contracts
        • Whatsapp Connection Status still "Pending" after migration

          Hello, I migrated my WhatsApp API to Zoho from another provider a day ago. So far the connection status is still “Pending”. There is a problem? How long does it usually take?
        • Kaizen #226: Using ZRC in Client Script

          Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this
        • Search Bar positioning

          Why is the Search bar on the far right when everything is oriented towards the left?
        • How to use Rollup Summary in a Formula Field?

          I created a Rollup Summary (Decimal) field in my module, and it shows values correctly. When I try to reference it in a Formula Field (e.g. ${Deals.Partners_Requested} - ${Deals.Partners_Paid}), I get the error that the field can’t be found. Is it possible
        • How to Filter timewise question to check uploaded one month or two months before in these community question ?

          i want to find the question that is asked some month or before any particular year, so how can i filter it ?
        • Send Whatsapp with API including custom placeholders

          Is is possible to initiate a session on whatsapp IM channel with a template that includes params (placeholders) that are passed on the API call? This is very usefull to send a Utility message for a transactional notification including an order number
        • Welcome to the Zoho ERP Community Forum

          Hello everyone, We are thrilled to launch Zoho ERP (India edition), a software to manage your business operations from end to end. We’ve created this community forum as a space for you to ask questions, comment answers, provide feedback, and share your
        • Proposal for Creating a Unique "Address" Entity in Zoho FSM

          The "Address" entity is one of the most critical components for a service-oriented company. While homeowners may change and servicing companies may vary, the address itself remains constant. This constancy is essential for subsequent services, as it provides
        • How to apply customized Zoho Crm Home Page to all users?

          I have tried to study manuals and play with Zoho CRM but haven't found a way how to apply customized Zoho CRM Home Page as a (default) home page for other CRM users.. How that can be done, if possible? - kipi Moderation Update: Currently, each user has
        • Workflow Down/Bug

          We have a workflow that sends an email to one of our internal departments 10 minutes after a record is created in a custom module. The workflow actually works correctly. However, we have now noticed that on January 8, between 3:55 p.m. and 4:33 p.m.,
        • Please can the open tasks be shown in each customer account at the top.

          Hi there This has happened before, where the open tasks are no longer visible at the top of the page for each customer in the CRM. They have gone missing previously and were reinstated when I asked so I think it's just after an update that this feature
        • Service Locations: Designed for Shared Sites and Changing Customers

          Managing service addresses sounds simple—until it isn’t. Large facilities, shared sites, and frequently changing customers can quickly turn address management into an operational bottleneck. This is where Service Locations deliver clarity and control.
        • Can I re-send the Customer Satisfaction Survey after a ticket closure?

          Hello, Some customers does not answer the survey right after closure, is it possible to re-send after a few days or weeks? Best Regards!
        • Filter contacts based on selected category in Zoho Desk ticket

          Hello community, I’m setting up the Tickets module in Zoho Desk and I need help implementing the following: When a category is selected in a ticket, I want the Contact field to be filtered so that it only displays contacts that are related to that category.
        • Mapping a new Ticket in Zoho Desk to an Account or Deal in Zoho CRM manually

          Is there any way for me to map an existing ticket in Zoho desk to an account or Deal within Zoho CRM? Sometimes people use different email to put in a ticket than the one that we have in the CRM, but it's still the same person. We would like to be able
        • Introducing Multi-Asset Support in Work Orders, Estimates, and Service Appointments

          We’re excited to announce a highly requested enhancement in Zoho FSM — you can now associate multiple assets with Work Orders, Estimates, and Service Appointments. This update brings more clarity, flexibility, and control to your field service operations,
        • Assign Income to Project Without Invoice

          Hello, Fairly new user here so apologies if there is a really obvious solution here that I am just missing... I have hundreds of small deposits into a bank account that I want to assign to a project but do not want to have to create an invoice every time
        • Tracking Non-Inventory Items

          We have several business locations and currently use zoho inventory to track retail items (sales and purchase orders). We were hoping to use zoho inventory to track our non-inventory items as well (toilet paper, paper towels, etc). I understand that we
        • Profile Page View Customization

          I need to change the fields, sections from the profile view of an emplyoyee.
        • Zoho Desk Android app update: Filter, Sort and Saved filters Enhancements

          Hello everyone! We are excited to introduce the below features on the Android version Zoho Desk mobile app: 1. Filter & Sort support has been introduced for the Contacts and Accounts modules. 2. Sort options is now available in Custom Modules as well.
        • Zoho CRM Meetings Module Issues

          We have a use-case that is very common in today's world, but won't work in Zoho CRM. We have an SDR (Sales Development Rep) who makes many calls per day to Leads and Contacts, and schedules meetings for our primary Sales Reps. He does this by logging
        • How to filter Packages in zoho inventory api

          Hi Team, I want to perform some tasks in a schedular on the packages which are in "Shipped" state. I tried to use filter_by in my api call but in return I get response as {"code":-1,"message":"Given filter is not configured"} My Api request is as follows
        • Accessing shared mailboxes through Trident (Windows)

          Hi, I have a created a couple of shared mailboxes. The mailboxes are showing up on the browser based Zoho workplace, but I cannot seem to figure out how to access my shared inboxes through Trident (Windows). Am I missing something or is this feature not
        • Issues Logging into ZOHO

          Hello, one of my coworkers is having issues logging into ZOHO, she has requested a code when entering and the email is correct but she has not received the code. can you help us with this?
        • Feature Request: Ability to set Default Custom Filters and apply them via URL/Deluge

          I've discovered a significant gap in how Zoho Creator handles Custom Filters for reports, and I'm hoping the Zoho team can address this in a future update. This limitation has been raised before and continues to be requested, but remains unresolved. The
        • Closing the Loop: Why Lookup Asymmetry is Harming Data Integrity in Creator

          TL;DR: Lookup fields allow users to add new related records inline via the "+" icon, but there's no equivalent ability to edit an existing related record without navigating away and losing form context. Adding a native "Edit" icon—with automatic User
        • Syncing with Google calendar, Tasks and Events

          Is it possible to sync Zoho CRM calendar, task and events with Google Calendar's tasks and events. With the increasing adoption by many major tool suppliers to sync seamlessly with Google's offerings (for instance I use the excellent Any.do task planning
        • filtering lookup field options based on information in another module.

          In our CRM system. We have the standard Accounts and Deals modules. We would like to introduce the ability to classify Accounts by Sector. Our desired functionality is to have a global list of all sectors that an Account can select, with the ability to
        • Really want the field "Company" in the activities module!

          Hi team! Something we are really missing is able to see the field Company when working in the activities module. We have a lot of tasks and need to see what company it's related to. It's really annoying to not be able to see it.🙈 Thx!
        • Cliq iOS can't see shared screen

          Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
        • Service op locatie organiseren met Zoho FSM: waar lopen organisaties tegenaan?

          Bij organisaties met service teams op locatie merken we vaak dat de complexiteit niet zozeer in de planning zelf zit, maar in wat er rond die planning gebeurt. Denk aan opvolging na interventies, consistente servicerapporten, en het bijhouden van installaties
        • Introducing Assemblies and Kits in Zoho Inventory

          Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
        • Automate pushing Zoho CRM backups into Zoho WorkDrive

          Through our Zoho One subscription we have both Zoho CRM and Zoho WorkDrive. We have regular backups setup in Zoho CRM. Once the backup is created, we are notified. Since we want to keep these backups for more than 7 days, we manually download them. They
        • Does the ability exist to make tax on the customer profile mandatory?

          I am reaching out to inquire about the possibility of making the "Customer Tax" field mandatory when creating a new customer in Zoho. We want to ensure that all customers have their tax information recorded to maintain compliance with our internal processes.
        • CRM gets location smart with the all new Map View: visualize records, locate records within any radius, and more

          Hello all, We've introduced a new way to work with location data in Zoho CRM: the Map View. Instead of scrolling through endless lists, your records now appear as pins on a map. Built on top of the all-new address field and powered by Mappls (MapMyIndia),
        • IMAP mail after specify date

          Hi My customer's mail server is on premise and mail storage is very huge. So It never finish sync. and finally stop sync. Cloud CRM have a option like zoho mail sync mail after some date.
        • How to integrate XML with Zoho CRM

          Hi, I have an eCom service provider that gives me a dynamic XML that contains order information, clients, shipments... The XML link is the only thing I have. No Oath or key, No API get... I want to integrate it into Zoho CRM. I am not a developer nor
        • email association with CRM

          Why is it 2024 (almost 2025) and Zoho has not figured out how to integrate email with CRM? It is so inconsistent at associating emails within CRM. I am an attorney. I have clients and work with other attorneys. Attorney John Doe is associated with multiple
        • Fix the speed

          It takes ages to load on every step even though my dataset is quite small.
        • Next Page