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.

      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

          • 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,

          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

                                  • Multi-currency and Products

                                    One of the main reasons I have gone down the Zoho route is because I need multi-currency support.  However, I find that products can only be priced in the home currency, We sell to the US and UK.  However, we maintain different price lists for each. 
                                  • Default Tagging on API-generated Transactions

                                    If one assigns tags to an Item or Customer, those tags get auto-populated in each line item of an Invoice or Sales Order when one creates those documents. However, if one creates the Sales Order or Invoice via the API (either directly coding or using
                                  • DKIM cannot be enabled for the domain as no verified default selector present

                                    Hi Support Team, For Domain DKIM record trying to enable status. but showing error "DKIM cannot be enabled for the domain as no verified default selector present" So, please resolve the issue. Thank you.
                                  • unable to send message reason 554 5.1.8 Email outgoing blocked

                                    unable to send message reason 554 5.1.8 Email outgoing blocked
                                  • I can't log in to my account on Thunderbird

                                    I've just had to rebuild my PC (calamitous mess from Microsoft with Win10/Win 11 'upgrade' - they confirmed I had to start with a new build). I have used Zoho mail for years via Mozilla Thunderbird, but now I've had to download the latest version of TBird,
                                  • Should I Use DMARC?

                                    When I configure Zoho Mail's DMARC settings, it's mandatory to fill in the RUA and RUF (Aggregate notification email address*, Forensic notification email address*) addresses. When we enter an email address in these fields, we receive reports from the
                                  • Introducing Profile Summary: Faster Candidate Insights with Zia

                                    We’re excited to launch Profile Summary, a powerful new feature in Zoho Recruit that transforms how you review candidate profiles. What used to take minutes of resume scanning can now be assessed in seconds—thanks to Zia. A Quick Example Say you’re hiring
                                  • Books API Receiving an Error that Doesn't Make Sense when Creating Credit Note - trying to use 'ignore_auto_number_generation' argument

                                    Hello, I'm working on a newly created routine and I'm getting an error that doesn't make sense when trying to create a new Credit Note. Here is my POST request. Endpoint: https://www.zohoapis.com/books/v3/creditnotes?organization_id=########## Body:     {
                                  • How do i move multiple tickets to a different department?

                                    Hello, i have several tickets that have been assigned to the wrong department.  I am talking about hundreds of automatically generated ones that come from a separate system. How can i select them all at once to move them to another department in one go? I can select them in "unsassigned open tickets view" but i can't find a "move to another department" option. I also can't seem to assign multiple tickets to the same agent in that same view. Could somebody advice?
                                  • Zoho Desk API Documentation missing a required field

                                    We are trying to create a section using this information. Even after preparing everything based on that page, we still get an error. The error we get is this: {"errorCode":"INVALID_DATA","message":"The data is invalid due to validation restrictions","errors":[{"fieldName":"/translations","errorType":"missing","errorMessage":""}]}
                                  • How to move emails to Shared Mailbox?

                                    Hello, I created a Shred Mailbox instead of using a distribution group. But I cannot move previous emails to certain shared mailbox. Is it possible move some emails from inbox to shared mailbox?
                                  • 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?
                                  • 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. Latest update
                                  • Send email template "permission denied to access the api"

                                    Hello, Per the title, I'm trying to send a Zoho CRM Email template based on the advice given here: https://help.zoho.com/portal/en/community/topic/specify-an-email-template-when-sending-emails-in-custom-functions (I'd prefer to send right from Deluge
                                  • Zoho Inventory Now Supports VeriFactu for Businesses in Spain

                                    Starting from January 1, 2026, Spain requires real-time invoice reporting for all B2B transactions. From July 2026, this requirement will extend to B2C transactions as well. All reporting must be carried out through the VeriFactu to AEAT (Agencia Estatal
                                  • Connection to other user

                                    Zoho Cliq handles sharing of Custom OAuth Connections that require individual user logins.
                                  • Issue in Annual Leave

                                    We created a policy to credit 21 days at the Start of the Year An employee has taken 16 days of leaves thought the year, so we expect to see 5 Leaves remaining right? But Zoho People is Showing 12 Days of Leave Balance Available If we check the Leave
                                  • Missing information data Zoho inventory

                                    there some missing data in Zoho inventory connection. pick list stock counts bin location we have requested it via mail and the support team doesn’t gove feedback. has anyone achieve to get these info or to ask other ya les
                                  • In arattai received message can't be deleted

                                    The issue has been noticed in following: arattai app (Android) arattai app (Window) arattai web While the message posted by me may be deleted, the ones received from others can't be. The item <Delete> change to <Report> when the message is a received
                                  • Enhance productivity with the revamped Zoho Sheet View

                                    Hello folks, For some time now, you've been able to use the Zoho Sheet View to quickly edit multiple records or to insert a batch of new records. Its tabular interface allows users to engage in these tasks productively. Despite this, the existing Sheet
                                  • Analytics Portal

                                    I have the "standard plan" and want to explore the portal option; I activated the 15-day trial but do not see the pricing for the add-on. How can I get the price under "Upgrade add-ons." Thanks Rudy
                                  • Can I filter a Lookup field to only show related records from another Lookup in Zoho CRM?

                                    In our Leads module, we have two Lookup fields: Recruitment Agency – the agency that the lead came from Recruiter – the individual contact from that agency who sent us the lead Both fields link correctly to their respective records in CRM. However, our
                                  • Zoho Books API invoice email bouncing with 'relaying-issues' error

                                    I have waited over 30 days for zoho books uk to assist with the following and i have had no replies or tickets erronously closed. The service has been terrible - very unlike zoho! So i am raising this here hoping that a community member can assist: Hello,
                                  • How do I filter contacts by account parameters?

                                    Need to filter a contact view according to account parameter, eg account type. Without this filter users are overwhelmed with irrelevant contacts. Workaround is to create a custom 'Contact Type' field but this unbearable duplicity as the information already
                                  • Zoho Writer to Zoho Sign Template Misalignment – Request for Community

                                    We are currently facing a critical issue impacting our live business operations due to a misalignment problem between Zoho Writer templates and Zoho Sign output. Issue Summary: We have an automated workflow in Zoho CRM using Deluge scripts that generates
                                  • Account blocked

                                    Yesterday I got my Zeptomail account blocked due to too many hard bounces. My account is used exclusively for sending transactional emails (eg. your order has been shipped, a form has been filled, etc) and the sudden blocking impacted hundreds of websites
                                  • IF Formula

                                    Hi, I'm having trouble setting up a custom formula in a field. Can you help me with it? The formula should do the following: If the created date is less or equal to 30 days the field should display a string New in pieline or Exisitng pipeline if above
                                  • View comprehensive logs of all actions in Custom Module History

                                    Hello everyone, We are happy to announce our new feature, Detail View in Custom Module History, which enhances visibility, control and accountability over your records. Users can now access a detailed timeline of every action that has been performed on
                                  • Track ZohoForm Conversion using Postmessage event

                                    Hi, I’ve been using a third-party lead tracking tool to capture leads from my website along with their source. Earlier, with the HubSpot form, the third-party script was able to detect the postMessage event that iframe forms typically send back to the
                                  • Email task creator when task is updated/marked complete

                                    I am looking for a way to notify the creator of a task in zoho todo when - Task is updated Task is closed Comments entered 1 and 2 are critical, and I cannot find a zoho flow to do this. There is no way that as a manager I will know when someone has completed
                                  • Email Recall Feature In Zoho Mail Which Should Also Work For Outside Organisation Members

                                    Add a feature to recall or undo sending an email within a configurable short time window (e.g., 30 seconds to 2 minutes) after hitting send, similar to Gmail’s undo send. Currently the sent email can not be recall If the recipient is not from within your
                                  • How to implement calculating average value of averaged values?

                                    Hi, I'm trying to implement a formula in my layout for a module that calculates the average of 2 averaged values, but I can't do so using the formula custom field. To calculate the 2 averaged values, I could use the formula custom field, but in the custom
                                  • How to restrict user/portal user change canvas view

                                    Hi , I would like to restrict user / portal user change their canvas view because I hide some sensitive field for them. I dont want my user switch the canvas view that do not belong to them But seems Zoho do not provide this setting?
                                  • Zoho Recruit update published job boards

                                    If we have a job thats already posted on several different job boards and we edit this job in zoho recruit (e.g. the description of the job), does this then automatically update this new information to all the published job boards?  If not, how does the
                                  • Narrative 14: The magic bazaar of Desk

                                    Behind the scenes of a successful ticketing system: BTS Series Narrative 14: The magic bazaar of Desk Marketplace is a centralized platform where users can discover Zoho and third-party applications that can be integrated with their Desk account to facilitate
                                  • Collections Management: #2 Late Payment Automation

                                    "Sir, I'll process the payment by evening, please don't apply any late payment charges", the customer said while arranging papers on his desk. Sanjay stood there with a tired smile. He had already visited twice that week. Payment collection was one thing.
                                  • Create a table in the layout section of modules

                                    Dear Sirs, I would like to know whether is possible to create a table under new fields in layouts section of modules. In fact in this section there are single line, multi line, pick list, multi-select, date, formula etc. but I am unable to add a table
                                  • Kiosk can't merge picklist or multiselect

                                    There is no ability to load a multiselect or picklikst field into a kiosk with the values that have been previously selected. So, I essentially have 3 unacceptable options: 1.)Load the value into a text string and include instructions like this: "Picklist
                                  • Nimble enhancements to WhatsApp for Business integration in Zoho CRM: Enjoy context and clarity in business messaging

                                    Dear Customers, We hope you're well! WhatsApp for business is a renowned business messaging platform that takes your business closer to your customers; it gives your business the power of personalized outreach. Using the WhatsApp for Business integration
                                  • 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
                                  • Next Page