Power of Automation :: Automated 'Delayed & Closed' Status Update Based on Due Date

Power of Automation :: Automated 'Delayed & Closed' Status Update Based on Due Date

Hello Everyone,


A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate complex tasks and calculations. 


Below is the use case ::

A custom status 'Delayed & Closed' is added into the task layout. When a task is closed, it should automatically compare the current date with the due date. If the current date is past the due date, the status must be updated to 'Delayed and Closed'.

This functionality can be implemented using Custom Functions and Task Workflow Rules. First, establish a connection with the Zoho Projects service using the scopes 'ZohoProjects.projects.READ, ZohoProjects.portals.ALL, ZohoProjects.tasks.UPDATE'.

Make sure to set the connection link name to ‘projects’ in the code provided below. The screenshots of Arguments & Task Workflow Rule is also attached for reference.

currentDate = zoho.currenttime.toString("MM-dd-YYYY","Asia/Calcutta");
newDateFormatConversion = toString(currentDate,format);
if(endDate != null){
updateTaskParameter = Map();
dateFormatConversion = toString(endDate,format);
daysDifference = daysBetween(dateFormatConversion,newDateFormatConversion);
if(daysDifference > 0)
{
// Get task layout details
taskLayoutDetailsResponse = invokeurl
[
url :endPoint + portalId + "/projects/" + projectId + "/tasklayouts"
type :GET
connection:"projects"
];
statusDetails = taskLayoutDetailsResponse.get("status_details");
for each  status in statusDetails
{
if(status.get("name").containsIgnoreCase("Delayed"))
{
delayedStatusId = status.get("id");
break;
}
}
updateTaskParameter.put("custom_status",delayedStatusId);
updateTaskResponse = zoho.projects.update(portalId,projectId,"tasks",taskId,updateTaskParameter,"projects");
}
}
return "success";

Creating custom functions in Zoho Projects is straightforward and well-documented. Zoho provides a range of built-in functions that you can use as a starting point, and you can also easily define your own functions using Zoho's scripting language, Deluge. Give it a try and see how it can save your time and boost your productivity!

Watch this space for more such custom function codes.

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Zoho Projects - Q3 Updates | 2025

            Hello Users, The final quarter of the year 2025 has begun, and we at Zoho Projects are all set with a plan. New targets to achieve and new milestones to reach, influenced by the lasting imprint of the past quarter. 2025's Q3 saw some new features and
          • Introducing Version-3 APIs - Explore New APIs & Enhancements

            Happy to announce the release of Version 3 (V3) APIs with an easy to use interface, new APIs, and more examples to help you understand and access the APIs better. V3 APIs can be accessed through our new link, where you can explore our complete documentation,
          • Schedule Exports for Regular Project Updates

            Tracking project data often means exporting data at regular intervals. Instead of manually exporting data every time, users can schedule exports for Phases, Tasks, and Tasks in Zoho Projects. These exports can be set to run once, daily, weekly, or monthly
          • Set Custom Business Calendars and Holidays for Global Teams

            Managing a project across diverse teams means accounting for more than just tasks and deadlines; it means acknowledging how and when each team actually works. Users might follow different working days or observe region-specific holidays that cannot be
          • Restore Trashed Records Anytime Within 30 Days

            Access the recycle bin from the Data Administration tab under the settings page in Zoho Projects, which gives better control over the trashed data. When records like projects, phases, task lists, tasks, issues, or project templates are trashed, they are

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ



                                ご検討中の方

                                  • Recent Topics

                                  • Send mass email using my secondary email

                                    Hello, When I send an email to just one person from Zoho CRM, a complete email editor appears, where I can choose which of my email addresses I want to use in the From field. When I send a mass email, there is not such option. I can only select the email template. When I configure an email template, I can choose who is in the From field, but I can't set it to use my secondary address. The only way to send a mass email using my secondary address that I can think of is swapping my two addresses in
                                  • List of hidden features

                                    Hi Friends, I had another support chat today and low and behold the feature that I wanted just simply needed to be "enabled". I thought I'd share, and maybe see if others had some similar experiences. 1. This one is from 5 ish years ago. I asked if there
                                  • Items Below Reorder Point Report?

                                    Is there a way to run a report of Items that are below the Reorder Point? I don't see this as a specific report, nor can I figure out how to customize any of the other stock reports to give me this information. Please tell me I'm missing something s
                                  • Old vs New Value for Deleted Lookup Values

                                    Suppose the following scenario, where a value in a lookup is deleted: 1. User has countries form 2. Form A has a lookup to countries form 3. User selects Italy in Form A and saves it with the Italy ID 4. Form A report shows Italy 5. Italy is inadvertently
                                  • customize payment page

                                    Is there a way to customize, other than the theme colour, the payment page that customers are taken to from invoices? I can't seem to find a way. I just don't like the formatting of the current page and would like to make it look better. I've looked at
                                  • Zoho Books | Product updates | August 2025

                                    Hello users, We’ve rolled out new features and enhancements in Zoho Books. From the right sidebar where you can manage all your widgets, to integrating Zoho Payments feeds in Zoho Books, explore the updates designed to enhance your bookkeeping experience.
                                  • Are Environments Worth It?

                                    In concept, Environments in ZC is a great idea. I think the flow is pretty smart when you compare it to GitHub, especially for a low code audience. However, in practice, I've found it to be unpredictable, and I've only used it a few times. Aside from
                                  • Enhanced duplicate check for Leads in CRM

                                    Hello Everyone, We are excited to announce that you can now check for duplicate entries in leads by comparing them with similar records in the Contacts Module. Previously, when you added a lead, only the converted leads were checked for duplicates. This
                                  • Pause(1);

                                    I'm using scheduler to invoke an interaction via http post with an external service. The schedule code uses a for-each loop that runs so fast my external application's log files get messed-up (they are named by date-time stamp). What I'm suggesting is
                                  • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

                                    The address field will be available exclusively for IN DC users. We'll keep you updated on the DC-specific rollout soon. It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition. Managing addresses
                                  • Integration Request: Elementor

                                    Integrating Zoho CRM forms with Elementor, the most popular page builder on Wordpress, would be great. I use it for our site, goenergylink.com, and I have had to use Zapier webhooks to be able to connect it with Elementor. The one issue I have run into
                                  • Ability to Change Visibility of Published YouTube Videos

                                    Hi Zoho Social Team, How are you? We would like to request an enhancement in Zoho Social regarding the management of already published youtube videos. Currently, after publishing a youtube video through Zoho Social, there is no option to change its visibility
                                  • Published Course Not Reflecting In Hub

                                    Hi! I am trying to create micro-learning courses for our team to be available for self-guided learning. I have published the courses with enrollment settings open to all users of the hub, but they don't appear to be available for enrollment. Am I missing
                                  • Adding anchor links in Zoho CRM email templates

                                    I know you can add anchor link in Campaigns, but I dont see the option to that in the CRM email template. Am I missing something?
                                  • Support “Never End” Option for Recurring Meetings in Zoho Meeting

                                    Hello Zoho Meeting Team, Hope you are doing well. We would like to request support for creating recurring meetings with no end date in Zoho Meeting. Currently, when scheduling a recurring meeting, Zoho Meeting requires us to select a specific end date.
                                  • openUrl in blueprints

                                    My customer wants to open a URL at the end of a blueprint transition. Seems this isn't possible right now but it would be very useful. In this thread, https://help.zoho.com/portal/en/community/topic/openurl-not-working the Zoho agent said that it's logically
                                  • Is it possible to pull the Zoho desk data into Zoho analytics in real time

                                    Hi - I am looking to add more dashboards and reports of Zoho Desk in analytics. I see there is a schedule to pull the data into analytics, but I'm wondering if there is an option to pull the data in real time instead of a specific interval?
                                  • Item Details Field - New Barcode / Document option?

                                    Is this a new feature??? its in both books and inventory.
                                  • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

                                    Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
                                  • Introducing the revamped What's New page

                                    Hello everyone! We're happy to announce that Zoho Campaigns' What's New page has undergone a complete revamp. We've bid the old page adieu after a long time and have introduced a new, sleeker-looking page. Without further ado, let's dive into the main
                                  • Ability to Add YouTube Video to Playlist During Publishing

                                    Hi Zoho Social Team, How are you? While publishing YouTube videos through Zoho Social, we noticed that the platform currently does not allow selecting a playlist at the time of publishing. Instead, we can only add the video to a playlist after it has
                                  • Nouveauté dans Zoho Writer - Création de documents et de modèles assistée par l'IA

                                    Zia, l’assistant IA de Zoho Writer, soutient les utilisateurs dans l’amélioration de leur écriture et la création de contenus : correction orthographique et grammaticale en temps réel, suggestions adaptées au contexte, détection du plagiat, révisions
                                  • Canvas View in Zoho Recruit

                                    Is it possible or would it be possible to have the new 'Canvas View' in Zoho Recruit?
                                  • Sharing Form Ownership Among Multiple Users

                                    I would really like the ability to share form ownership among multiple users. It's frustrating to me that if a co-worker wants to make an edit to a form, I have to transfer ownership to them. It would be great if forms could act like google forms, where multiple people can edit a form and view responses. 
                                  • How to go to the next open ticket in the queue when agents closes ticket

                                    Zoho Desk When agent closes a ticket - eg when they choose 'Send and Close" - where is the setting that automatically redirects them to the next open ticket in the queue?
                                  • How to Automate Email Sequence

                                    I'm having trouble trying to set up a workflow to automate an email sequence. Once a group of emails in a Task has been tagged by a certain tag, I want an instant email template to be sent. After 7 days with no response, another email template would be
                                  • Marketer’s Space - Ace Your Spooky-Season Marketing with Pre-designed Templates in Zoho Campaigns

                                    Hello marketers, Welcome back to another post in Marketer’s Space! We’re in Q4, which means that you have endless opportunities to connect with your audience, starting with Halloween campaigns! In this post, we’ll show you how to design the perfect Halloween
                                  • Turning off the new UI

                                    Tried the new 'enhanced' UI and actively dislike it. Anyone know how to revert back?
                                  • Zia expands to China with native features and DeepSeek-powered generative AI features

                                    Hello everyone, We are glad to support Zia native features and Zia generative AI features for our customers in China. From hereon, all AI-features in Desk will be accessible in China data center with the integration of DeepSeek generative AI model. DeepSeek
                                  • Email in each module

                                    We have a contact ,module which then has a link to customer assets which in turn the asset has a multiple link to service visits. When we link assets to customers we choose by name and it brings over the associate email via the lookup. Great feature.
                                  • Create custom rollup summary fields in Zoho CRM

                                    Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
                                  • Global Search placement in the new UI

                                    Having a hard time with the global search placement in the UI redesign. Surely I can't be the only one. Previously global search placement was perfect. A bar at the top/center of the page. Exactly where you would expect it to be. Since the new UI has
                                  • Introducing Skill-Based Ticket Assignment

                                    The goal of every support team is to provide great support, and to do so as fast as they can. To make this possible, it is important that agents spend their time judiciously, especially when they're dealing with a large number of tickets of varying urgency
                                  • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

                                    Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
                                  • Kaizen #213 - Workflow APIs - Part 1

                                    Welcome to another week of Kaizen! If you have ever managed complex business processes, you know that Workflows are the quiet backbone of any well-run business process. They keep things moving; assigning owners, sending alerts, keeping deals on track,
                                  • Browser and address bar hide

                                    Hi, How i can do hide the address bar with browser headline when i am working on the sheet, because i am using (freeze panes) which i want visible for full work. For your reference here i am attached the screen shot and marked yellow lines which really
                                  • Cells Border

                                    Hi I am using Zoho Sheet on S Tab , is there any option to make all border of any cell at once. I think this is very basic which we are missing. This is available in mobile but not in tab or suggest if i am missing this function. And for Tab can you give
                                  • Credit Management: #2 Configuring Right Payment Terms for Credit Control

                                    Think about the last time you ordered something online and saw that little note at the checkout, "Pay on Delivery" or "Pay later". It's simple, but it actually sets the tone. As a business owner, you know exactly when payment is expected. Now, imagine
                                  • Zobot and Sales IQ

                                    What will happen to the Zoho Sales IQ being integrated to the website after creating the Zobot on the website too
                                  • Workflow workdrive rollout

                                    Hi! When will workflow be rolled out to all users? Thanks.
                                  • Next Page