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

          • Update on V2 API End-of-Life Timeline

            Dear Users, Earlier this year, we shared the launch of the V3 APIs and requested users to migrate from the older V2 APIs by December 2025. We have received valuable feedback from our users and partners regarding their migration timelines. We are happy
          • Automation Series: Auto-assign Task Followers

            As task progresses, several users are required to stay aware of the updates to plan their upcoming work items efficiently. Manually adding users as followers for an active task might create additional overhead. With this automation, followers can be added
          • WhatsApp Business Integration for Zoho Projects

            Delivery channel plays a decisive role in how quickly certain project updates translate into immediate actions. A release is ready to go live. An issue is marked critical. An approval is pending. These moments are less about tracking and more about timely
          • Enhanced Collaboration and Global Web Tabs

            Hello Users, We are rolling out two key enhancements in Zoho Projects that will be part of our November release. Here’s what to expect: 1. Collaboration Section in the Left Navigation Panel What’s new? All communication and interactive tools will be grouped
          • Choosing the Right Automation in Zoho Projects

            In any project, different types of actions are needed at different points. Some projects require control on how tasks move, some require reacting to updates, and some require executing additional actions beyond the task. Automation in Zoho Projects is

          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

                                  • Custom Button Creation from Layout Editor in Zoho CRM

                                    Hello All, Buttons in Zoho CRM act as triggers that perform a specific action when clicked. Zoho CRM includes a set of system buttons that help you carry out common actions with a single click. Beyond these, your organization can create custom buttons
                                  • How to Switch from Outlook for Mac to Outlook for Windows

                                    The most often used file formats for users to manage crucial data are OLM and PST files. PST files keep a copy of data on the configured system from Outlook, while the OLM file contains the Mac Outlook data items, which are only accessible with Outlook
                                  • Different languages for users

                                    Hello, Do you plan to enable individual users to select their languages for interface? Currently language can be changed for everyone - it looks like a settings for a whole portal, which is not good when you are working internationally. Best regards,
                                  • Issues migrating Google email

                                    I am considering Zoho because Google will start charging for G Suite legacy free edition.    So, a key element in my decision is the ability to migrate as much from Google as possible.  I am giving email a try first, but after hours of trying, I can't
                                  • "Print" option of GET Expense Report API not working

                                    Hello! I have been trying to use the "print" option of the GET Expense Report API but it seems the option does not alter the output. Is there an issue with the API or am I using it wrong? Here's my request code, in Deluge: response = invokeurl [ url :"https://www.zohoapis.com/expense/v1/expensereports/"
                                  • Related List Expanded View in Zoho CRM: see more related records at a glance, filter and take bulk actions

                                    Hello everyone! Related lists show you the records connected to what you're working on: contacts under an account, activities tied to a deal, products linked to a quote. But until now, you could only see 10 records at a time. If you needed to filter results
                                  • Add Comprehensive Accessibility Features to Zoho Writer

                                    Hello Zoho Writer Team, We hope you are doing well. We would like to submit a feature request to enhance Zoho Writer with a full set of accessibility tools, similar to the accessibility options already available in the Zoho Desk agent interface. 🚧 Current
                                  • How to automatically update a % field according to a dropdown field in the Quote table

                                    Hello there, I have following couples: Success % Status 0% NP 30% No Feedback 50% PR 80% Opp. Concreta 100% A I would like the Success % field (percent) to automatically update based on the item of the Status field (dropdown). The fields are within the
                                  • CRM iOS App Missing Tags support

                                    Hi, I remember reading either a tread on iOS (Maybe Later) & Android (i believe Now Supported) regarding “Tags” in the mobile apps unfortunately I can’t seem to find either. Could we clarify are “Tags” support coming to CRM iOS app as searching the forums
                                  • Marketing Tip #41: Add a clear value proposition to your homepage

                                    When someone lands on your homepage, they should understand what you sell and why it is worth exploring within 5 seconds. If your homepage is too vague, cluttered, or focused only on design, visitors may leave before they even start browsing. A strong
                                  • Zoho Writer adds conditional logic and AI assistance to formulas: A step toward dynamic document automation

                                    Hi users, We are excited to announce new formula enhancements in Zoho Writer. This includes: New string formulas: Use 12 new string functions to dynamically transform and manipulate text in documents and automation templates. Conditional formulas: Configure
                                  • What's New in Zoho Billing | June 2026

                                    Hello users! June brings a new set of updates to Zoho Billing designed to strengthen how you manage subscriptions, customise your records, and handle expense documentation. This month's highlights include a new one-time addon quoting workflow for subscriptions,
                                  • What's New in Zoho Inventory | June 2026

                                    Hello partners, June 2026 introduces a range of exciting enhancements to Zoho Inventory. With the full rollout of the Zoho Inventory Windows application, the launch of Terminal Payments, and new tracking combinations in Advanced Inventory Tracking, you
                                  • [Zoho Writer webinar] Driving productivity through document automation

                                    Live webinar on July 9, 2026 | Time: 2 PM IST | 2 PM EST Hi Zoho Writer users, Creating, reviewing, approving, and distributing business documents manually can slow teams down and introduce errors. Join our live webinar to learn how Zoho Writer helps
                                  • Free Webinar Alert! Zoho Workplace + Zoho Billing: Align Rev-ops and collaboration for greater efficiency

                                    Hello Zoho Community! Want to make your billing process more connected and efficient? Join our upcoming webinar to see how Zoho Workplace and Zoho Billing work together to streamline your day-to-day operations. In this session, we'll show you how to manage
                                  • Canvas View: Add font family selection (incl. Google Fonts / Hebrew & RTL fonts)

                                    Hi Zoho CRM team, The Canvas design suite (List View, Tile View, Table View and Record Detail) currently allows customizing font weight, size, color, alignment and case - but there is no option to choose the font family. All text is rendered in the built-in
                                  • 【無料/オンライン】7/22開催|Zoho ワークアウト|ユーザー同士で学び合うオンラインもくもく会

                                    ユーザーの皆さま、こんにちは。 コミュニティグループの中野です。 7月開催の「Zoho ワークアウト」のご案内です。 本イベントは、Zohoユーザー同士で交流しながら、 設定・検証・運用改善を進めるオンラインの「もくもく会」です。 「設定を進めたいけれど、一人だと手が止まってしまう」 「他社がどう活用しているのか知りたい」 「同じ課題を抱える仲間と話したい」 そんな方にぴったりのイベントです。 ▶︎ 参加登録はこちら(無料 ) URL:https://us02web.zoom.us/meeting/register/t7lA28wlQceRW6sZpeFEhQ
                                  • DYK 9: Dependent Layout Rules

                                    Did you know that you can configure dependent fields in Task and Issue Layouts? In a project, tasks and issues vary in nature and so do the fields needed for each. Displaying relevant fields and values keeps the layout organised and ensures necessary
                                  • Does anyone else wish you could download Mail Merge quotations from the Zoho CRM mobile app?

                                    Is it just me, or has anyone else run into this? I’m in sales, so I’m rarely at my desk. I’m usually in meetings, visiting clients, or travelling. One thing that genuinely frustrates me is that if a client asks me for a quotation, I can’t generate or
                                  • Introducing parent-child ticketing in Zoho Desk [Early access]

                                    Hello Zoho Desk users! We have introduced the parent-child ticketing system to help customer service teams ensure efficient resolution of issues involving multiple, related tickets. You can now combine repetitive and interconnected tickets into parent-child
                                  • Update on default settings for AI features in Cliq

                                    Hello all, We'd like to provide clarity on a recent change to AI feature defaults in Cliq. As part of our regular review of AI features conducted in April 2026, we re-evaluated how these features are enabled by default. We've decided that the AI features
                                  • Text on Zoho Sign confirmation dialouge is very small compared to text used everywhere else on Zoho Sign.

                                    I've reported multiple times through Zoho's support email that the text on this notification is very small in contrast to all the other text on the Zoho Sign app. I think it's a bug and it just needs the font size to be increased. It's very minor but
                                  • Cliq iOS can't see shared screen

                                    Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                  • Zoho CRM custom button function, how to add line breaks/ new lines in the return message

                                    When creating button function in CRM it requires a `return "";` Then when the button is client by the user a message pops up with what ever is returned from the function. But I want to have a message with multiple lines, meaning I need to add a line break
                                  • Feature Request: Dynamic Date Filter Criteria

                                    Please implement the ability to select a dynamic date for all Filter Criteria. This would be helpful to create views that don't constantly need to be updated (example custom date field on an account) Examples: - Today - Tomorrow - This week - This Month
                                  • SalesIQ's Summer '26 Release: For The Moments That Matter

                                    Every customer journey is made up of moments. The moment someone discovers your business. The moment they need help. The moment you decide to reach out. The moment a simple chat turns into something more. And the moments that continue long after the conversation
                                  • There is no link between Deals and Projects in Analytics

                                    Hello there, I am trying to link Deals with Projects in a Pivot view on Zoho Analytics. However, there is no relationship, yet on CRM there is a relationship. As you can see below, there is no link between them: However, on CRM, if you go into a Deal,
                                  • How to Access Zoho Mail Messages to Microsoft Outlook? - Zoho Mail Converter

                                    Zoho Mail is the free email hosting service which provide mailing with CRM service, so if you are one of them who is trying to import Zoho Mail emails to Outlook then keep reading. In this article we are going to provide accurate solution that will help you to import Zoho Mail emails to Outlook format in Batch. Zoho Mail service provide option to export mailbox in Zip format. So first – Export Zoho Mail emails in Zip format later use Zoho Mail to Outlook Converter to migrate Zoho emails into PST
                                  • Zoho Cliq REST APIs v3 : A complete guide to what's changed and why 

                                    APIs are not just consumed by a developer with numerous automations and a series of open browser tabs. They are parsed by LLMs, fed into agent pipelines, and auto-completed by AI coding assistants that have zero tolerance for inconsistency. A verb tucked
                                  • Feature Request: Include Creator-applicable Deluge updates in the Creator Release Notes

                                    I'd like to put forward a suggestion about how Deluge updates are surfaced to Zoho Creator developers, and I'm hoping the Creator team will consider it. Zoho Creator is built on Deluge. Every workflow, custom function, validation and schedule we write
                                  • Zoho CRM Reports Module on Mobil App

                                    I have the mobile app and the reports module doesn't appear in the sidebar for some reason. I saw a Youtube video where the user had the Reports module on mobile. Is there a setting to show it on mobile? Thanks.
                                  • Sigma function call hangs forever from Desk widget — app_install_id/encapiKey are null

                                    Calling ZOHODESK.request() from the widget to invoke a Sigma DRE function URL hangs forever (never resolves, never rejects, no error) until client timeout. Tried with merge fields app_install_id={{sigmaInstallId}}/{{installationId}} and encapiKey={{enCapApiKey}}
                                  • Workdrive on Android - Gallery Photo Backups

                                    Hello, Is there any way of backing up the photos on my android phone directly to a specific folder on Workdrive? Assuming i have the workdrive app installed on the phone in question. Emma
                                  • Auto sync Photo storage

                                    Hello I am new to Zoho Workdrive and was wondering if the is a way of automatically syncing photos on my Android phone to my workdrive as want to move away from Google? Thanks
                                  • Postcode problems

                                    So we were very pleased to see we could limit shipping with postcodes. Brilliant. Unfortunately we have discovered It does not seem fit for purpose. In the UK we write postcodes in various ways Examples BH217NL BH21 7NL Bh217nl bh217NL and many more ways
                                  • Getting Notifications but unable to load email

                                    I am getting notifications through the web browser and my phone app that i am receiving emails, but i can not open the email to view. Below is the screen shot of the console panel.
                                  • WORKFLOW ISSUE: Zoho Finance Extension

                                    Workflows are no longer triggering in my extension. This is true for the testing environment and 5 other organizations it is installed on. There are no conditions set for the workflow, and this is true for both create and delete related actions. Workflows
                                  • Zoho CRM Layout Rules: Nine New Actions, Profile-Based Execution, and Interactive Preview

                                    Hello everyone, Availability: This feature is now available for customers in the JP and SA DCs. It is planned to be released for other customers in soon. We’re excited to announce powerful new enhancements to Layout Rules in Zoho CRM - a feature built
                                  • Certain items certain shipping

                                    Me again it would be helpful to have different shipping for different categories. Our example are salt. Delivery is free but have a minimum delivery. Pickup is cheaper so it has its own category- pickup.
                                  • Zia Agents looks promising, but I still cannot deploy my first agent or connect WhatsApp after weeks of support tickets

                                    Hi Everyone, I am posting here because I am stuck and need practical help from someone who has successfully deployed a Zia Agent with WhatsApp. Zia Agents looks like a very promising product. I have watched the platform expand quickly, and I have noticed
                                  • Next Page