Automation Series: Auto-update Task Closure Field Based on Due Date

Automation Series: Auto-update Task Closure Field Based on Due Date

In a project, tasks are owned and worked on by different users and each progresses at a different rate. With Zoho Projects, the task delay duration can be calculated automatically when a task runs past its due date. This gives project managers better visibility into delivery estimates without checking each task individually.

Consider an onboarding team working on tasks such as Contractor Enrolment, Implementation Timeline Discussion, and Lead Assignment, each aligned to a go-live schedule. As work moves forward, tasks are picked up and worked on by different members along the way. It gets tedious to calculate task delays individually as the project expands, making delivery reviews repetitive and time consuming.

 Whenever a task is marked as Completed, the workflow rule is triggered and the associated custom function compares the task Completion date against its Due date. Tasks that closed on or before the Due date are updated as On Time in the Closure field. Tasks that closed after the Due date are updated as Delayed and the number of overdue days is calculated and updated automatically. This helps project managers determine tasks that consistently take longer than planned, so future timelines can be adjusted before delays happen.

To configure this flow in your Zoho Projects portal,

      1. Navigate to the upper-right corner of the page and click   → Customization → Layouts and Fields → Tasks.
      2. Click the required layout and drag and drop to create the following Custom status and fields:
    1. Closure - Custom Picklist field with two values: On Time and Delayed.
    2. Days - Number field to capture the number of days delayed. This field will only populate when the closure status is Delayed.
    3. Stop - Checkbox field to prevent the Workflow Rule from repeatedly triggering after the task is updated.
    4. Re Open and Completed - Ensure the following statuses are available in your Task Layout. 


      3. Click Save.
      4. Navigate to   → Developer Space → Connections.
      5. Click Create Connection, choose Zoho Projects as the service, and add the following scopes:
    1. ZohoProjects.tasks.UPDATE
    2. ZohoProjects.portals.READ
    3. ZohoProjects.projects.READ


      6. Navigate to Custom Functions under Developer Space.
      7. Click the Tasks tab in the upper navigation panel.
      8. Create a new custom function and add the following 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.tasks.UPDATE, ZohoProjects.portals.READ, ZohoProjects.projects.READ
  2. projectsV3Endpoint = "https://projectsapi.zoho.in/api/v3/portal/";
  3. endPoint = "https://projects.zoho.in/restapi/portal/";
  4. format = "dd-MM-yyyy";
  5. statusName = "Completed";
  6. // Get task layout details
  7. taskLayoutDetailsResponse = invokeurl
  8. [
  9. url :endPoint + portalId + "/projects/" + projectId + "/tasklayouts"
  10. type :GET
  11. connection:"fieldupdateoncompletion"
  12. ];
  13. statusDetails = taskLayoutDetailsResponse.get("status_details");
  14. for each status in statusDetails
  15. {
  16. if(status.get("name").equalsIgnoreCase(statusName))
  17. {
  18. completedStatusId = status.get("id");
  19. }
  20. }
  21. params = Map();
  22. if(endDate != null)
  23. {
  24. days = daysBetween(toDate(zoho.currentdate.toString(format),format),toDate(toString(endDate,format)));
  25. if(days >= 0)
  26. {
  27. params.put("closure","On time");
  28. params.put("stop",true);
  29. updateTask = invokeurl
  30. [
  31. url :projectsV3Endpoint + portalId + "/projects/" + projectId + "/tasks/" + taskId
  32. type :PATCH
  33. parameters:params.toString()
  34. connection:"fieldupdateoncompletion"
  35. ];
  36. }
  37. if(days < 0)
  38. {
  39. delayedDays = days * -1;
  40. params.put("closure","Delayed");
  41. params.put("days",delayedDays);
  42. params.put("stop",true);
  43. updateTask = invokeurl
  44. [
  45. url :projectsV3Endpoint + portalId + "/projects/" + projectId + "/tasks/" + taskId
  46. type :PATCH
  47. parameters:params.toString()
  48. connection:"fieldupdateoncompletion"
  49. ];
  50. }
  51. }
  52. params.clear();
  53. params.put("status",{"id":completedStatusId});
  54. updateTask = invokeurl
  55. [
  56. url :projectsV3Endpoint + portalId + "/projects/" + projectId + "/tasks/" + taskId
  57. type :PATCH
  58. parameters:params.toString()
  59. connection:"fieldupdateoncompletion"
  60. ];
  61. return "success";
Info
  1. Lines 2 and 3: Replace the domain in the endpoint URLs to match your data centre.
  2. Line 5: Replace "Completed" with the custom task closure status configured in your portal.
  3. Lines 11, 34, 48 and 59: Replace "fieldupdateoncompletion" with your Zoho Projects connection name.
  4. Line 27: Replace "On time" with the Closure field value configured in your portal.
  5. Line 40: Replace "Delayed" with the Closure field value configured in your portal.
  6. Lines 24, 25, 37, 39, and 41: Replace "days" with the API name of your number field if it has been renamed.
      9. Add the following arguments during configuration.



      10. Click Save.
      11. Navigate to   → Automation → Workflow Rules.
      12. Click the Tasks tab in the upper navigation panel and click New Workflow Rule.
      13. Select Based on User Action as the execution condition and execute the rule when a task is Updated.
      14. Click Add Criteria+ and set the following criteria:
    1. Task Status Is Completed
    2. AND Stop Is Disabled
Notes
If you have configured a Custom Status or using the default Closed status, ensure the Task Status in the Workflow Rule criteria is set to match your portal configuration.
      15. Click +Add Action and select Update Field. Set Status to custom status Re Open.
      16. Click +Add Action again and select Associate Custom Function. Select the custom function created previously.



      17. Click Save Rule.
      18. Toggle the Workflow Rule Status on to enable it.



With this automation in place, teams can automatically track on-time and delayed tasks along with overdue days. This gives project managers better visibility into delivery timelines.

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

    Access your files securely from anywhere

          Zoho FSM Video Tutorials


                All-in-one knowledge management and training platform for your employees and customers.






                                      Zoho Developer Community




                                                            • Desk Community Learning Series


                                                            • Digest


                                                            • Functions


                                                            • Meetups


                                                            • Kbase


                                                            • Resources


                                                            • Glossary


                                                            • Desk Marketplace


                                                            • MVP Corner


                                                            • Word of the Day


                                                            • Ask the Experts



                                                                      • Sticky Posts

                                                                      • DYK 14: Create Tasks with AI

                                                                        Did you know AI can suggest tasks within your Zoho Projects portal? Breaking a project into clear, actionable work items takes time and manual effort. Especially when the same team handles both planning and execution. AI task suggestions in Zoho Projects
                                                                      • Introducing CodeX Scripts for Custom Modules

                                                                        When a project involves processes beyond the usual modules such as tasks and issues, teams often create Custom Modules to keep information organized in a way that fits their workflow. Once those records become part of the process, there may also be specific
                                                                      • Create Custom Module Using AI in Zoho Projects

                                                                        Every team has its own way of managing work. While standard modules support common project management needs, many business processes require their own structure, fields, and terminology. With AI-powered Custom Modules in Zoho Projects, users can create
                                                                      • Collaborate Visually with Whiteboard in Zoho Projects

                                                                        Whiteboard in Zoho Projects allows you to collaborate visually by creating diagrams, annotating designs, and sketching project workflows using shapes, text, and images within project modules. Team members can work simultaneously, improving productivity
                                                                      • Create Flexible Layouts with Layout Rules

                                                                        In a project, when a work moves from planning to execution, the information teams need can change at every stage. A project can need one set of details, a phase can need another, and a custom process may require an entirely different set of information.


                                                                      Manage your brands on social media



                                                                            Zoho TeamInbox Resources



                                                                                Zoho CRM Plus Resources

                                                                                  Zoho Books Resources


                                                                                    Zoho Billing Resources

                                                                                      Zoho Projects Resources


                                                                                        Zoho Sprints Resources


                                                                                          Qntrl Resources


                                                                                            Zoho Creator Resources



                                                                                                Zoho CRM Resources

                                                                                                • CRM Community Learning Series

                                                                                                  CRM Community Learning Series


                                                                                                • Kaizen

                                                                                                  Kaizen

                                                                                                • Functions

                                                                                                  Functions

                                                                                                • Meetups

                                                                                                  Meetups

                                                                                                • Kbase

                                                                                                  Kbase

                                                                                                • Resources

                                                                                                  Resources

                                                                                                • Digest

                                                                                                  Digest

                                                                                                • CRM Marketplace

                                                                                                  CRM Marketplace

                                                                                                • MVP Corner

                                                                                                  MVP Corner






                                                                                                    Design. Discuss. Deliver.

                                                                                                    Create visually engaging stories with Zoho Show.

                                                                                                    Get Started Now


                                                                                                      Zoho Show Resources

                                                                                                        Zoho Writer

                                                                                                        Get Started. Write Away!

                                                                                                        Writer is a powerful online word processor, designed for collaborative work.

                                                                                                          Zoho CRM コンテンツ


                                                                                                            Nederlandse Hulpbronnen


                                                                                                                ご検討中の方





                                                                                                                          • Recent Topics

                                                                                                                          • Grouping by Stage *type* in widgets

                                                                                                                            Hi Can I ask for a new feature? I'd like to be able to group by stage type in a Deal widget. That is by whether the Deal is in an Open Stage, a Closed Won Stage, or a Lost stage. Currently I can group by Stage, but if we have 10 open stages and one Closed
                                                                                                                          • How to disable automatic ticket closure emails for specific outgoing communications?

                                                                                                                            Is there a way to disable the automatic "Ticket Closed" email notification for specific tickets or outgoing emails? Currently, every time we send an email to a customer, the system automatically sends a "Ticket Created" email, followed by a "Ticket Closed"
                                                                                                                          • Sharing View Only Portal

                                                                                                                            Im looking at Youtube videos on how to share a view only link to my projects. Everyone has the screen with Manage Users. I don't have it. Is that an old version or new version? I can't see how to send a view only link to clients. There is a Profiles and
                                                                                                                          • Unable to export reports despite enabled report export permissions

                                                                                                                            Hi Zoho Community, We are unable to export reports in Zoho CRM. When attempting an export, we receive the following error: “Cannot Export Report — You do not have permission to export one or more modules used in this report. Please contact your administrator.”
                                                                                                                          • Allow widgets to be placed between native sections in the Ticket Properties panel

                                                                                                                            One of our biggest frustrations with the Tickets module is how rigid the Ticket Properties panel is. Every section there is built only from native Zoho Desk fields. We can add sections, rearrange fields, and pick layouts, but we can’t put anything custom
                                                                                                                          • What does "Tickets for Review" do?

                                                                                                                            What is the purpose of the va nilla view " Tickets for Review?"
                                                                                                                          • Zoho Desk training for administrators in EU and US region

                                                                                                                            Hello Everyone, Get ready for the certified Virtual Classroom training for our Zoho Desk users in Europe and the US. Our in-house Zoho Desk expert, @Dheeraj | Zoho Desk, will conduct the virtual classroom training. This training focuses on simplifying
                                                                                                                          • Set same ticket Threshold for Agent-Level Thresholds

                                                                                                                            I am creating Agent-Level Thresholds for agents to auto-assign tickets in a Load-based Round Robin rule. I am unable to set the same number of Open tickets for agents when setting their Thresholds. For exampel: Agent 1 = 10 Agent 2 = 25 Agent 3 = SHOULD
                                                                                                                          • Zoho Mail MCP connector

                                                                                                                            Issue: Zoho Mail MCP connector (https://mail-organization-930963415.zohomcp.com/mcp/.../message) — OAuth authorization completes successfully in-browser ("Authentication successful"), but the issued token is rejected when the MCP client reconnects to
                                                                                                                          • Zoho Books | Product updates | October 2026

                                                                                                                            Hello users, October brings a range of new features and enhancements to Zoho Books, designed to simplify compliance, streamline accounting workflows, and improve inventory management. From the launch of the Nigeria Edition and France’s e-invoicing capabilities
                                                                                                                          • Multiple criteria in searchRecords

                                                                                                                            Hi, is it possible to search with multiple criteria in zoho.crm.searchRecords? I have tried several variations of the following without much success. CustomerRecord = zoho.crm.searchRecords("Contacts", "(First Name|=| lee)" && "(Last Name|=| spencer)"); Thanks. Chris
                                                                                                                          • Plans to make "Generate Presentation with Zia AI" available as API endpoint?

                                                                                                                            This 'Generate Presentation with Zia' feature has great potential, and we would like to be able to trigger it automatically from a workflow. https://show.zoho.com/home/ziaai/generate Is there already a way to trigger this via API? If not, is there any
                                                                                                                          • How to setup noreply@ example.com

                                                                                                                            How do I setup noreply@example.com so the mail never gets delivered. I currently have a catchall setup aswell.
                                                                                                                          • Pleas unblock E-Mail-Adress service@montana-energie.de / kontakt@montana-energie.de

                                                                                                                            Dear Zoho Support, Could you please unblock service@montana-energie.de / kontakt@montana-energie.de which belongs to a regular customer with whom we are having frequent business-related conversations. Thank you very much in advance, Erdem Kar homewise
                                                                                                                          • Unable to change alias in the from field on the ZOHO mac app

                                                                                                                            I have 1 main mail address, and 3 alias's. on the web mailbox when I create a new email, I can select the alias's from the dropdown in the from field. On the app no dropdown is available.
                                                                                                                          • Zmail mobile application

                                                                                                                            ho do i remove people from this app
                                                                                                                          • My allies email (info@xxxx.com) was been deleted by system, and I can not build the same info allies email now

                                                                                                                            Dear Zoho Mail Support Team, I am the super administrator of the Zoho organization 【Organization Name, as shown in Admin Console】. I am writing to report an urgent issue with two of our custom-domain email addresses and to request your help restoring
                                                                                                                          • Cannot create mail account

                                                                                                                            Hi, i have a problem, i can't create a mail account every time i try the error massage like this Oops! Something went wrong during mailbox creation. Please try again please help
                                                                                                                          • Amazon.it always ends up in spam

                                                                                                                            Emails from amazon.it always end up in the spam folder, even though I have added the domain and the various individual Amazon addresses for shipping, payments, and other matters to the trusted lists at the user administrator level. What should I che
                                                                                                                          • Your Authenticate email domain (SPF, DKIM, DMARC) is bad to say the least

                                                                                                                            How about actual instructions rather than vague generalities? There is no way to complete this with what is provided. Please provide specific verifiable steps.
                                                                                                                          • Generate a Zoho Sign link

                                                                                                                            From time to time I get a response "I never received your you e-document for electronic signature" is there a way to generate a Zoho Sign link to share.
                                                                                                                          • ChatGPT Plugin / MCP Server auth error

                                                                                                                            Hi all I'm trying to connect the ChatGPT plugin for Zoho CRM but after username stage of the auth process, I get this error from the URL https://mcp.zoho.eu/mcp-client/ {"error_description":"Invalid request url, Request is not as per defined in oauth
                                                                                                                          • Zeptomail in the blacklists

                                                                                                                            Hello, I noticed some hard bounces while sending emails, and upon checking the details, I see that we have been added to the blacklists of certain spam lists: Bounce category: Policy failure Reason: ip-issues Message: 5.7.1 Service unavailable; client
                                                                                                                          • Possible to reorder Pipelines position?

                                                                                                                            I have multiple Pipelines and want to reorder their positions, so that in the Deals module record for the Pipeline field, I have them ordered in a certain way. Is there a way to reorder the position of the Pipelines without deleting existing Pipelines
                                                                                                                          • Categorize Items with Item Headers

                                                                                                                            Hello customers, Did you ever want to classify items based on specific categories to help your customers understand your invoice better? With the new Item Header feature, you can easily categorize items in your invoices and estimates and give them a common title.  Item Headers are available in the Invoices, the Recurring Invoices and the Estimates module. It can be carried forward from estimates to invoices at the time of converting the estimates.  To add an item header: Go to the Estimates, Invoices
                                                                                                                          • Gettting "You are Offline" Messages all the time

                                                                                                                            Al of a sudden, a few days ago, I suddenly began getting a message on the bottom left side of the Mail App saying "You are Offline". Why? Does it mean I'm not getting incoming mails now? why is has started?
                                                                                                                          • Zoho CRM Quotes – Subform and PDF/Writer Limitations

                                                                                                                            Hello, I am encountering the following limitations in Zoho CRM Quotes: Custom product images cannot be uploaded in the subform – the image upload field cannot be added; only the file upload field is available. File upload placeholders cannot be used in
                                                                                                                          • Invoice Only Shipped Items

                                                                                                                            Dear Zoho, We are a company that deals with sales orders with 600-1000 lines We need to be able to do partial invoicing based on shipped items Right now when we click convert to invoice we can not only select items that have een shipped It takes hours
                                                                                                                          • Alias Email Id already exists

                                                                                                                            Hi, I just verified my domain sesque (dot) com and now I am trying to create the admin account using admin (at) sesque (dot) com, but I am getting an error saying "Alias Email Id already exists". I used to have another Zoho account with this email address,
                                                                                                                          • Show backordered items on packing slip

                                                                                                                            We send out a lot of large orders, and often there are one or two things backordered. How can I fix the packing slips to show quantity ordered  & quantity packed There should also be the ability to "ship" 0 of an item so the receiver knows that things
                                                                                                                          • Deleted Module

                                                                                                                            I accidentally deleted a module and its fields. Im trying to get it back. Thanks to Youtubers flooding the internet with out of date videos I can't find how to get deleted modules back. The Recycle Bin doesn't have modules. Anyone know how to do thi
                                                                                                                          • Set department automatically for incoming calls

                                                                                                                            Is it possible, when receiving an incoming call through Zoho Desk (using Twilio integration), for the department to be auto-selected based on the phone line being called? Currently, we have to manually select the department from the dropdown menu when
                                                                                                                          • Make better hiring decisions with Compare Applications and Zia Insights (Beta)

                                                                                                                            When multiple candidates apply for different job openings, evaluating each application against the right job requirements can take time. Reviewing resumes, candidate details, and interview feedback separately can make it harder to assess role fit and
                                                                                                                          • Support Plan: Recuring Issue

                                                                                                                            Hi Zoho Team, Could you please look into this recurring alert and provide clarification on why this restriction is still in place? This issue has become a bottleneck in our workflow, significantly limiting our automation capabilities. We are unable to
                                                                                                                          • mail sent to gmail goes directly to spam

                                                                                                                            Hi TKIM and SPF are configured and verified. E-mails coming from zoho to my personal gmail account are going directly to the spam folder. How can I solve this? I can send you guys the headers privately if you need to.
                                                                                                                          • Creating packages according to actual shipping processes

                                                                                                                            Hi community. I would like to ask a question to see if there's a better method or workflow for the creation of packages in Zoho Inventory. There is a little confusion in some of Zoho's language relating to the use of term Packing Slip when connected to
                                                                                                                          • mail

                                                                                                                            We want our tracked links in campaign and journey emails to use our own domain instead of the shared maillist-manage.net domain. We have already created the CNAME links.rexven.com → customer-campaign.zoho.com (DNS only). Does our plan support a custom
                                                                                                                          • Zoho Webinar - Sharing System Audio (NOT AVAILABLE)

                                                                                                                            Hi, We are having a serious problem with Zoho Webinar. In the webinars we run, we very often share the audio from a video we are streaming directly from YouTube or other applications. Until recently we were using Zoom, but as we use other Zoho applications
                                                                                                                          • Ad-hoc approvals are now available in CRM approval processes

                                                                                                                            Released for all DCs. Hello everyone, We've introduced ad-hoc approvals in CRM approval processes. This enhancement lets approvers add additional approvers when needed, without changing the configured approval workflow. How the approval process works
                                                                                                                          • Introducing PRM: Build, manage, and scale your partner ecosystem

                                                                                                                            Growing a partner ecosystem is a good problem to have. What starts as a handful of partners can quickly turn into a maze of spreadsheets, emails, and disconnected processes. More partners mean more opportunities, greater reach, and new ways to grow
                                                                                                                          • Next Page