Power of Automation :: Automatic Task Status Handling for Users

Power of Automation :: Automatic Task Status Handling for Users

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 ::

Each user may have only one task in the “In Progress” status at any given time.

When a new task is set to “In Progress,” any other task currently in the same status for that user shall be automatically updated to “On Hold.”

The Hold Reason field should be automatically populated with a message indicating the new task ID, for example “Automatically placed on hold because Task #123456 was set to In Progress.”

This functionality can be implemented using Custom Functions. First, establish a connection with the Zoho Projects service using the scopes 'ZohoProjects.tasks.ALL'.

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

projectsV3APIEndPoint = "https://projectsapi.zoho.in/api/v3";
projectsAPIEndPoint = "https://projectsapi.zoho.in/restapi";
statusName = "On Hold";

if(taskOwnerDetails.get(0).get("full_name").equalsIgnoreCase("Unassigned User")) {
return "Owner not assigned";
}
ownerId = taskOwnerDetails.get(0).get("zpuid");
usersParam = Map();
usersParam.put("user_type","active");
taskParam = Map();
// Create a custom view with all the open tasks that are not in "On Hold" status and replace it in the view_id variable below
viewId = "337480000003148137";
taskParam.put("view_id", viewId);
taskParam.put("filter",{ "criteria": [ { "field_name": "owner", "criteria_condition": "is", "value": [ownerId] } ], "pattern": "1" });
getAllTasks = invokeurl
[
url :projectsV3APIEndPoint + "/portal/" + portalId + "/tasks"
type :GET
parameters:taskParam
connection:"projects"
];
info getAllTasks;
if(getAllTasks.containsKey("tasks") && getAllTasks.get("tasks").size()>0) {
statusId = null;
/*  Close all tasks */
//Fetch task layouts
taskLayoutDetails = invokeurl
[
url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasklayouts"
type :GET
connection:"projects"
];
// info taskLayoutDetails;
if(taskLayoutDetails != null && taskLayoutDetails.get("status_details") != null)
{
statusDetails = taskLayoutDetails.get("status_details");
for each  status in statusDetails
{
if(status.get("name").equalsIgnoreCase(statusName))
{
// Fetch task status id based on status name
statusId = status.get("id");
info status.get("name") + " : " + statusId;
break;
}
}
}
if(statusId != null)
{
taskIds = list();
for each  task in getAllTasks.get("tasks")
{
projectId = task.get("project").get("id");
taskId = task.get("id");
if(taskId.equals(currentTaskId)){
info "Skipped";
} else {
/*Update task status to On Hold*/
updateTaskMap = Map();
updateTaskMap.put("custom_status",statusId);
updateTaskResponse = zoho.projects.update(portalId,projectId,"tasks",taskId,updateTaskMap,"projects");
/*Add comment*/
addCommentMap = Map();
taskURL = projectsEndPoint+portalName+"#zp/task-detail/"+currentTaskId;
addCommentMap.put("comment","Moved to Hold automatically because Task <a href="+taskURL+">"+task.get("prefix")+"</a> was set to In Progress");
addComment = invokeurl
[
url :projectsV3APIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/comments"
type :POST
parameters:addCommentMap.toString()
connection:"projects"
];
}
}
}
else
{
return "Status not found";
}
}
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.

    Access your files securely from anywhere









                          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

                                                          • 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
                                                          • Accessibility Spotlight Series - 1

                                                            Every user interacts with products differently, what feels intuitive to one may be challenging for another. Addressing this, accessibility is built into Zoho Project's design philosophy. This helps users navigate and perform actions with ease irrespective
                                                          • Customize User Invites with Invitation Templates

                                                            Invitation Templates help streamline the invitation process by allowing users to create customized email formats instead of sending a one-size-fits-all email. Different invitation templates can be created for portal users and client users to align with
                                                          • 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,


                                                          Manage your brands on social media



                                                                Zoho TeamInbox Resources



                                                                    Zoho CRM Plus Resources

                                                                      Zoho Books Resources


                                                                        Zoho Subscriptions 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

                                                                                                          • Account disabled

                                                                                                            I have an issue I need help with. Whilst trialing ZOHO CRM I created the following: Account1 (-------------) using m__ame@m__rg___s__i__.___.__ and 2 personal emails Account2 (-------------) using a personal email and 2 users _al__1@______________._o_.__
                                                                                                          • Blocked Email

                                                                                                            We are a Zoho One subscriber and use Yahoo as our MX provider. A few times each year, for the past four years, CRM blocks one or more of my Zoho One users from receiving internal email from CRM. This includes "@mentions" in all modules, and emails from
                                                                                                          • message var is empty in bot mention handler

                                                                                                            Hi, I'm encountering a problem: in my bot's mention handler, I want to retrieve the text the user typed when mentioning the bot. Example: On the #tests-cyril channel, I send this message: “@Donna hello how are you ?” I expect the system variable "message"
                                                                                                          • New Customization options in the module builder: Quick Create and Detail view

                                                                                                            Hello everyone, We have introduced two new components to the module builder: Quick create and Detail view. The Quick Create Component It is a mini form used to create a record and associate it to the parent record from a lookup field. For example, if you have a Deals lookup in the Contacts module, then you can associate existing deals or create a deal and associate it with the contact. You can customize this Quick Create form by adding standard as well as custom fields. There is no limit to the number
                                                                                                          • Remembrance Day to Remember – Recalling Values

                                                                                                            The phrase “at the eleventh hour” refers to the 11th hour of the 11th day of the 11th month in 1918, when the hostilities of World War I came to an end—but it still holds meaning today. Remembrance Day (Veterans Day in the US) is observed on November
                                                                                                          • Enhancing Zia's service with better contextual responses and article generation

                                                                                                            Hello everyone, We are enhancing Zia's Generative AI service to make your support experience smarter. Here's how: Increased accuracy with Qwen One of the key challenges in AI is delivering responses that are both contextually accurate and empathetic while
                                                                                                          • How to display two measures (sales and price) divided by categories on one line chart

                                                                                                            Hi everyone, I’m having trouble figuring out how to display two columns on a line chart with category breakdowns. What I need is a line chart where one line represents Sales and the other represents Price. However, the Price data is divided into around
                                                                                                          • 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
                                                                                                          • Introducing the locking option for CRM records

                                                                                                            Last modified on 06/04/2023: Record locking option in CRM is now available for all Zoho CRM users in all DCs. Note that it was an early access feature available only upon request. Hello All, Hope you're doing well! We're thrilled to introduce our latest
                                                                                                          • Two new enhancements in Zoho CRM: Introducing new criteria for user fields and displaying group information in users page

                                                                                                            Announcement moderated on 14th June, 2023. Dear All, These enhancements are opened for all users in all DCs. ------------------------------------------------------------------------------------- Dear All, Hope you're well! We are here with two useful
                                                                                                          • Tip #49- Navigating the Remote Support Dashboard in Zoho Assist- 'Insider Insights'

                                                                                                            The Remote Support dashboard in Zoho Assist is designed to help technicians quickly access, manage, and monitor all their support sessions from a single, intuitive interface. Whether you’re starting a new session, managing ongoing connections, or reviewing
                                                                                                          • BMI formula

                                                                                                            I've been trying for hours to calculate BMI using height and weight as my only inputs. It's a simple calculation and I even went to ChatGPT to help me figure this out in Zoho Forms, but it led me down a path of "try this" and "try this". None of my attempts
                                                                                                          • SEO on blogs

                                                                                                            Hello, google is not able to find my blogs. Can you advice me if I need to change some settings or anything else to make it retrievable via SEO many thanks, hans
                                                                                                          • Duplicated Notebooks

                                                                                                            Out of the blue, almost all of my notebooks got duplicated and the different copies contain different information. Some seem like older copies than the others. I use the linux desktop app and sometimes the Android app. I assume that the sync failed at some point and was unable to merge the two versions together. But I'm afraid to add anything else to my notebook because if it can't properly sync 5 notebooks with only a handful of notes each, what will happen when I have hundreds of notes and I lose
                                                                                                          • Samsung Keyboard Issues with Notebook

                                                                                                            Dear Users, We're sorry to inform you that some of our users are experiencing certain issues like scrolling, delay/lag, cursor placement especially within the text notes. This occurs mainly due to Samsung Keyboard compatibility with Android 13 and some
                                                                                                          • Mind mapping in Zoho Projects

                                                                                                            Good morning,   I would like to congratulate the Zoho team for building such an inovative and responsive application that fits in the daily challenges of so many work groups. I would like suggest you another functionality that helps a lot in project planning and development: mind mapping. Mind mapping would be of great help for brianstorming, knowledge management and other needs in online collaboration.   Thanks and wish you all the best! George Maha Empresa Júnior Multidisciplinar do Instituto de
                                                                                                          • Retainer invoice in Zoho Finance modlue

                                                                                                            Hello, Is there a way of creating retainer invoices in the Zoho Finance module? If not can I request this is considered for future updates please.
                                                                                                          • What's New in Zoho Inventory | August – October 2025

                                                                                                            Hello customers, The last quarter has been incredibly productive! We've released a powerful slate of new features and enhancements in Zoho Inventory designed to give you better control, greater efficiency, and expanded functionality across your inventory
                                                                                                          • Documents don't sync properly

                                                                                                            Hello, My team recently moved to Zoho workDrive, some of my team, work remotely so we believed Zoho would be the best way to share and edit files as well as access files withing the team. However we are experiencing sync issues, when a file is uploaded in the file explorer and shows sync complete, same file can be seen on the Zoho web app but other team members can't see the said file because it is not syncing properly. i figured out that if i were to go to preferences in settings and resync the
                                                                                                          • We are looking for an experienced Zoho Developer

                                                                                                            Hi Everyone! We’re on the lookout for a skilled Zoho Developer with hands-on experience in the Zoho Developer Platform (The Vertical CRM Platform) and if you don't know what that is, then you are not the person we are looking for. You would also need
                                                                                                          • Initiate approval workflow after "on edit --> on success"

                                                                                                            Dear Community,  currently I am working on a initiative tracker which should handle approval workflows based on different initiative status. As far as I understand, an approval workflow can be triggered (only?) when data is entered for the input form to the database.  Example: A new initiative is created and submitted. --> Approval Workflow triggered Here comes my question: Is it also possible to trigger an approval workflow if the form was "simply" updated? (on edit --> on success) Imagine the initiative
                                                                                                          • Collaboration with free plan user.

                                                                                                            Hello. Do both users need to be on Pro plan to collaborate? Or can a Pro user share a note with a free plan user with the ability to edit?
                                                                                                          • Tax Deductible Donations to a Charity Organisation

                                                                                                            For Australia, what's the best/proper method for entering an expense that is a tax deductible donation to a charitable organisation. And thus is appears correctly in Accounts and BAS as a GST payable deduction?
                                                                                                          • Simultaneous use of WhatsApp Account in SalesIQ and ZohoDesk

                                                                                                            Hi, We have only one number registered in Meta, it's possible use same account for two apps? All times here we try is stopping in SalesIQ. Regards,
                                                                                                          • External lookup fields to synchronise with Analytics

                                                                                                            Hello. I suggest adding external lookup custom fields to the Zoho Analytics integration settings. Currently, these types of fields are not available for synchronisation, so they cannot be used to generate reports with related tables in Analytics. Thank
                                                                                                          • We should have an option to Toggle Off KB Article Links in AI Answer Bot Replies

                                                                                                            Hi everyone, I'm creating this topic to share a feature idea that I think would improve the customer experience when using the AI Answer Bot for self-service. The Current Behavior (The Problem) Currently, when the AI Answer Bot generates a summary or
                                                                                                          • Boot Loop After Removing Service from Client via Admin

                                                                                                            We have multiple laptops experiencing a boot loop / unable to login after the Zoho Remote service was removed from their machine remotely via the desktop client. The Windows sign-in screen is not available, and users are unable to login. This seems like
                                                                                                          • Request Backend Correction — Domains Mapped to Same Help Center (Multi-Brand Setup Failure)

                                                                                                            Hello Zoho Desk Support Team, I need assistance correcting a domain-to-brand mapping issue in our Zoho Desk instance (The Blue Ribbon Project). Both of our verified domains currently point to the same Help Center instead of separate brand portals. Current
                                                                                                          • is there any option to enable the participants interact - can write on the screen, while the screen is shared by the host?

                                                                                                            this is most expected features - for teaching children. is there any option to enable the participants interact - can write on the screen, while the screen is shared by the host?
                                                                                                          • How to disable the Login button in Desk Helpcenter

                                                                                                            Hey there, I'm testing out whether the help center within Zoho Desk could replace our existing Customer FAQ. I tried to customize the themes for the public help center frontend, but stumbled across the login button in the navigation bar. Is there any
                                                                                                          • Very long loading times | bad performance [ZOHO DC: EU]

                                                                                                            Hello there, we have recently noticed that the loading times have become extremely long when retrieving tickets and ticket details. For example, I open any ticket and get the following view. The subject and standard information (ticket owner, status etc.)
                                                                                                          • Client Portal ZOHO ONE

                                                                                                            Dear Zoho one is fantastic option for companies but it seems to me that it is still an aggregation of aps let me explain I have zoho books with client portal so client access their invoice then I have zoho project with client portal so they can access their project but not their invoice without another URL another LOGIN Are you planning in creating a beautiful UI portal for client so we can control access to client in one location to multiple aps at least unify project and invoice aps that would
                                                                                                          • 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
                                                                                                          • Subforms in stateless forms

                                                                                                            I think the title says it all. We need to be able to add subforms to stateless forms. Currently the only workaround is to create a Form and delete each record upon submission of the form. I need to build an interface to update our inventory. Basically
                                                                                                          • Standard Payment Term is not pulled from account to quotation

                                                                                                            Hey Team There seems to be something off. I do have "Net 30" as my default payment term in Zoho Books for my customers. If, from the customer overview or quote section, I create a new Quotation, the payment terms field stays blank and doesn't get the
                                                                                                          • Zoho Analytics Export API

                                                                                                            Hi Team, I’m working on some integration tasks and wanted to confirm if it’s possible to retrieve a Zoho Analytics table as JSON data using a Deluge script. I’ve already stored my custom data from multiple sources and combined it into a single source.
                                                                                                          • Best way to display complex Bookings Consultation Descriptions on Zoho Site?

                                                                                                            I am a new user so apologies if this has been asked before. I couldn't find any answers in the forum. We offer 18 complex Consultations to our subscribers. Our current platform lets me put detail on these Consultations thoroughly (200-300 words) during
                                                                                                          • Gmail is ramping up its email sender policy as of November 2025

                                                                                                            Hello marketers, As you may be aware, Gmail introduced a guideline for bulk senders starting February 2024. If not, here's a quick refresher straight from Google: After this policy was announced first in 2023 and soft-implemented in February 2024, we
                                                                                                          • Modifying iframe data of Zoho booking iframe

                                                                                                            Hello, I have integrated a Zoho Bookings embedded iframe into my website. Currently, I am pre-filling the booking form with default values as part of our process flow. However, I want to ensure that if an input field is already populated with a default
                                                                                                          • Zoho CRM Workflow and Function Backup Options

                                                                                                            Hi everyone! I have been able to make several backups of my CRM data and noticed that the Workflows and Functions are not included in these backups. To my knowledge, there is no backup feature for workflows and functions, which is problematic in of itself.
                                                                                                          • Next Page