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

    Nederlandse Hulpbronnen


      • Recent Topics

      • Tip of the week #27: Edit personal calendars in Zoho Calendar.

        In Zoho Calendar, the personal calendars you create can be edited to make changes you need to make. Edit a Personal Calendar The following changes can be made to the personal calendar by editing it: Calendar title Calendar color Reminders and Description
      • Tip of the week #28: Show/ hide, enable/ disable and empty/ delete your calendars in Zoho Calendar.

        The popularity of online calendars has soared in recent years. It's used both for personal and professional reasons. Calendars have evolved into an effective productivity tool in our lives, from creating events for birthdays and anniversaries to scheduling
      • Tip of the week #30: Share calendars publicly in Zoho Calendar.

        In Zoho Calendar, calendars that are created under My Calendars can be shared publicly. Making your calendar public allows others to view it. When you need to share your calendar with a larger group, public sharing can help. You can restrict others from
      • Tip of the week #31: Share your personal calendars within organization.

        Keep your Organization members aware of what's happening. In Zoho Calendar, you can share your personal calendar with all the members in your organization using the Share with org option.When you enable org sharing for a particular personal calendar,
      • Tip of the Week #33: Appointment scheduler in Zoho Calendar.

        In Zoho Calendar, you can use the Schedule Appointment option to share your appointment request form with the public, allowing people to fill out the form to request an appointment with you. This form can be embedded on your website or blog. Visitors
      • Tip of the Week #34: Embed Calendars using Zoho Calendar

        You can make your calendars public and visible to the general public by embedding them in your websites/blogs using Zoho Calendar. You can use the embed code to add your own calendars to your website's/ blog's HTML code, and the calendar will appear on
      • Tip of the week #35: Migrate to Zoho Calendar from Google Calendar.

        If you are looking to move your Google Calendar events to Zoho Calendar, never worry about missing out the events from your Google Calendar. You can migrate the events from Google Calendar using the export option and import it to Zoho Calendar and manage
      • Tip of the week #36: Migrate to Zoho Calendar from Outlook Calendar.

        If you've been using Outlook calendar and looking to migrate to Zoho Calendar, you can seamlessly export your calendars from Outlook and import them into Zoho Calendar without losing any events, participants, and the reminders set for each event. To migrate
      • Shared calendar issues and duplications

        Apparently there was a calendar update?  Now when I schedule an event for a team member that has shared his calendar with me, the event makes me the organizer and adds the event to my calendar as well.  Previous to this "update" I would scheduled an event
      • Subscribed Calendar

        Hi i have subscribed to a calendar for Holidays in Canada it shows all the holidays perfectly but every one of them has the word Canada before the rest of the name is there a way to remove that word Canada? It takes up a lot of space in the square on
      • The year that was at Zoho Calendar 2023- Part 1

        Hello, amazing community members! Happy new year from all of us here at Zoho Calendar. As we begin the new year, we'd like to thank each and everyone of our community members for your unwavering support and love that you have shown for Zoho Calendar.
      • Zoho Calendar 2024: A Year in Review

        Hello, community members! Happy new year from all of us here at Zoho Calendar. As we turn the page to a new year, we extend our heartfelt gratitude to every member of our Zoho Calendar community for your continued support and enthusiasm. Your feedback
      • Zoho Calendar not syncing correctly with personal Google Calendar

        Coming to this forum as Zoho Calendar support team is not responding, any more. For the past 8 weeks, I have been having an issue with Zoho Calendar not syncing with my personal Google Calendar correctly. I subscribed to Zoho Calendar iCal in my personal
      • MTA - BAD IP reputation by outlook/hotmail

        Messages to Microsoft email servers are bouncing back due to poor reputation. Message: 4.7.650 The mail server [136.143.188.206] has been temporarily rate limited due to IP reputation. For e-mail delivery information see https://postmaster.live.com (S775)
      • Zeptomail API error 500 internal server error

        Hi Everyone, getting this eror continuously! Can anyone please guide around the same! Zeptomail API error 500 internal server error Best Regards
      • Waiting multiple days to buy credits, causing my website to suffer

        So I own a fairly large website that gets a lot of registered users. I use transmail send activation emails, and also forgot password emails. I sent an email to zoho's presales team when I was only at 4K/10K emails sent, hoping to buy more credits before
      • Follow up

        Hello, I sent a message 2 days ago but I don't receive any response and I cannot find my ticket here. this is the ticket: Your ticket has been created with the ticket ID 68925465 and subject "Fwd: Fishing-alert" looking forward to seeing your response.
      • What's new in TransMail!

        Note: TransMail is now ZeptoMail. Click here to know more. Hello again, everyone! We've recently crossed the 6 months mark of TransMail's launch. In this time post our launch, we have been constantly working on updating our platform and adding new features
      • June 2021 in TransMail!

        Note: TransMail is now ZeptoMail. Click here to know more. Hello again, everyone! Hope you and your loved ones are doing well. If you're doing less than fine, we truly hope that things only get better for you.  We've had a few updates in the past month
      • TransMail has a new name—ZeptoMail!

        Tried navigating to TransMail's community forum but see a different name now? That's because TransMail has a new name. TransMail is now ZeptoMail! As we’ve grown from an internal service used mainly by other Zoho products to an up-and-coming competitor
      • July 2021 in ZeptoMail!

        Note: TransMail is now ZeptoMail. Click here to know more. Hello again, everyone! Hope you and your loved ones are doing well.  We've had a few updates in the past month in ZeptoMail—some new features and some important announcements. Take look at what
      • Send Email From the ZeptoMail BY API

        What is Zeptomail:- Transactional email service with reliable and fast delivery How we can Create a Connection for Zeptomail in Zoho CRM Go to the Setup Click on Connection Enter Connection Details:- Generate Consumer Key & Consumer Secret Using Zoho
      • Customer email on Opencart 3

        When I place an order, 2 emails are sent: 1) administrator 2) to the user The administrator receives a beautiful letter, but the user receives a damaged letter (see screenshot). What could be the problem?
      • [Announcement] Insert image from URL changes in Zoho Writer

        Hi Zoho Writer users! We'd like to let you know that we've changed the behavior of the Insert image from URL option in Zoho Writer for security reasons. Earlier behavior Once you inserted an image URL in a Writer document, the image would be fetched from
      • Dynamic Signature - Record owner

        Hi everyone, I’m using Zoho Writer merge templates from Zoho CRM and have two questions: Owner signature: How can I automatically insert the CRM record owner’s signature in the merged document? I’m not sure where this signature is stored or how to reference
      • Writer sing up problom

        Zoho writer sing up prolom face
      • Unable to copy into a new document

        Whe I create a new Writer doc and attemp to copy and past I get this message. The only way to copy into a document is I duplicate an existing document, erase the text and save it under a different name and then paste the information. Not ideal. Can you
      • [Webinar] Live demos and user Q&A with Zoho Writer product experts

        Join us on June 12, 2025 for live demos based on your use cases and real-world scenarios raised via form. This is also an opportunity to get your questions answered directly by product experts from the Zoho Writer team. Webinar agenda Live demos based
      • Zoho Writer's built-in citation and bibliography generator

        Hey researchers and writers! Do you manually format citations and bibliographies, spending hours jumping between apps and tabs? If so, then check out Zoho Writer's built-in "Citations and Bibliography" feature. Imagine you're writing a thesis on the future
      • Single and group checkboxes in Zoho Writer's fillable forms

        Hey Writer Fam, Are you making the most out of single and group checkboxes in fillable forms in Zoho Writer? Here is a handy tip to optimize your use of checkboxes, both single and group, and enhance your data collection process. Single checkboxes: Single
      • Collaborate efficiently with Zoho Writer's track changes feature

        Hi Zoho Writer Community, Zoho Writer's track changes feature is a simple, built-in solution that helps you and your team work together efficiently. Instead of juggling multiple versions of a document or building up a long email chain of comments, each
      • Zoho Writer's WordPress extensions

        Hey Zoho Writer users! Say goodbye to all your WordPress content publishing woes with Zoho Writer's WordPress extensions. Publish content with all your formatting and images, republish content when you update a document, and more—from a single window
      • Time-saving table hacks

        Hey Zoho Writer Community, Do you find yourself using a lot of tables in your documents? We're here to share some of our time-saving hacks that will help you work more efficiently, organize your data, and make your documents look neat and professional.
      • Automating document approval and signing with Zoho Writer and Zoho Sign

        Hey Zoho Writer Community! Here's another automation tip to make your processes more efficient! Question: Can I send a document for client approval first, then automatically send it for signing with Zoho Sign if they approve? Since it's the same person
      • Customization hacks in Zoho Writer - Part 2

        Hey community, We're back with some more tricks to personalize your documents, save time, and get in the zone when you work in Writer. Check out part 1 of this post if you haven't already. Let's dive right in! Document ruler units Imagine you're creating
      • Simplify your tax calculations with Zoho Writer

        Hello Zoho Writer Community! Tax season can be stressful, but with Zoho Writer, managing your income tax calculations becomes straightforward and efficient. Here’s an example of how you can use the tables and formulae of Zoho Writer to calculate income
      • Enhance document navigation with headings and TOC

        Hey Zoho Writer Community! We're back with some useful features in Zoho Writer that can simplify your document creation and navigation process. Let's dive right in! Check out our video on how to make the most of Zoho Writer's heading and table of contents
      • Use and download in PDF format of Zoho wirter Merge template using deluge

        Hello Zoho Developers. Here is some information about Zoho Writer. Writer is not just another online word processor, it's a powerful tool for editing, collaboration, and publishing. Even with its wide range of features, Writer's pared-down user interface
      • Customization hacks in Zoho Writer - Part 3

        Hello everyone, Welcome back to Part 3 of our customization tips in Zoho Writer! In this third installment, we'll be diving into some essential customization settings that can enhance your document creation experience. Sender email address in mail merge
      • Daytime saving timezones messing up writer pdf

        Hi, I need help for something I can't figure out. I created a Form to collect data and it is set up with my current Daylight Saving Time (GMT-3). This form is used to generate a contract (pdf Writer) with dates from an event that is being held in 4 months
      • Next Page