Automation Series: Auto-update Phase Status

Automation Series: Auto-update Phase Status

Hello Folks!

You can auto-update your phase's status based on status of underlying tasks using custom functions.

In this series, we will showcase how to create and run custom functions, using Deluge, with ease. Follow the steps below and automate your project management process.

Use-case

Consider a scenario where a sales representative manages all his customers conversations as tasks in Zoho Projects. To stay organised, he divides the year into four quarters and sets up one milestone for each.
He wants the milestone status to be updated automatically once all the tasks in a milestone are updated.

So, if every task in Q1 is marked In Progress, the milestone status should automatically be updated to In Progress. When all tasks are Completed, the milestone should also be completed.

Configuration Flow

To automate this process, the sales representative should
  1. Create custom status for tasks and milestones.
  2. Establish a connection.
  3. Create a custom function using Deluge.
  4. Define a Workflow Rule to set a trigger.

Create Custom Status:

Create a custom status by double-clicking the Status column name in the milestone and task list view.

Establish a connection:

A Connection is a secure and reusable authentication layer that lets your custom functions and integrations communicate with external services or other Zoho apps.
Users can select the relevant scopes to create a connection. Scopes for this particular use case are,

Zohoprojects.portals.all,
Zohoprojects.projects.all,
Zohoprojects.tasks.all,
Zohoprojects.milestones.all

Click here to learn how to establish a connection.

Create a custom function:

You don't need development expertise to execute this custom function. Zoho Projects manages the underlying execution. Simply add the function code, map the required inputs, and the system will run it automatically whenever the workflow is triggered.

Sample connection name - milestonestatus
Sample status name - In Review

Arguments required:

Arguments are variables or parameters that pass an input value to execute a custom function.


  1. //scopes: Zohoprojects.portals.all, Zohoprojects.projects.all, Zohoprojects.tasks.all, Zohoprojects.milestones.all
  2. endPointV3 = "https://projects.zoho.in/api/v3/portal/";
  3. endPoint = "https://projects.zoho.in/restapi/portal/";
  4. milestoneStatusIds = List();
  5. milestoneStatusNames = List();
  6. milestoneParameter = Map();
  7. statusName = "In Review";
  8. indexValue = 0;
  9. rangeValue = 100;
  10. taskStatusId = "";
  11. state = true;
  12. // Get task layout details
  13. taskLayoutDetailsResponse = invokeurl
  14. [
  15. url :endPoint + portalId + "/projects/" + projectId + "/tasklayouts"
  16. type :GET
  17. connection:"milestonestatus"
  18. ];
  19. statusDetails = taskLayoutDetailsResponse.get("status_details");
  20. for each status in statusDetails
  21. {
  22. if(status.get("name").notContains(statusName))
  23. {
  24. taskStatusId = taskStatusId + status.get("id") + ",";
  25. }
  26. }
  27. taskStatusId = taskStatusId.removeLastOccurence(",");
  28. taskResponse = zoho.projects.getRecordById(portalId,projectId,"Tasks",taskId,"milestonestatus");
  29. milestoneId = taskResponse.get("tasks").get(0).get("milestone_id");
  30. id_list = taskStatusId.toList(",");
  31. chunk_size = 4;
  32. count = 0;
  33. chunk = List();
  34. all_chunks = List();
  35. for each id in id_list
  36. {
  37. count = count + 1;
  38. chunk.add(id);
  39. if(count == chunk_size)
  40. {
  41. all_chunks.add(chunk);
  42. chunk = List();
  43. count = 0;
  44. }
  45. }
  46. if(chunk.size() > 0)
  47. {
  48. all_chunks.add(chunk);
  49. }
  50. for each sub_chunk in all_chunks
  51. {
  52. param = sub_chunk;
  53. // Get All Tasks
  54. taskParameter = Map();
  55. taskParameter.put("custom_status",param.toString());
  56. taskParameter.put("index",indexValue);
  57. taskParameter.put("range",rangeValue);
  58. taskParameter.put("milestone_id",milestoneId);
  59. tasks = zoho.projects.getRecords(portalId,projectId,"tasks",taskParameter,0,"milestonestatus");
  60. if(tasks.containKey("tasks"))
  61. {
  62. state = false;
  63. break;
  64. }
  65. }
  66. if(state)
  67. {
  68. // Get milestone layout details
  69. info "in";
  70. milestoneLayoutDetails = invokeurl
  71. [
  72. url :endPointV3 + portalId + "/projects/" + projectId + "/milestones/layouts"
  73. type :GET
  74. connection:"milestonestatus"
  75. ];
  76. milestoneCustomFieldDetails = milestoneLayoutDetails.get("section_details").get(0).get("customfield_details");
  77. for each milestoneCustomFieldDetail in milestoneCustomFieldDetails
  78. {
  79. if(milestoneCustomFieldDetail.get("api_name").equalsIgnoreCase("status"))
  80. {
  81. milestoneStatusIds = milestoneCustomFieldDetail.getJSON("picklist_details");
  82. milestoneStatusNames = milestoneCustomFieldDetail.getJSON("picklist_valuemap");
  83. }
  84. }
  85. // Milestone re-open status id
  86. indexOfReopen = milestoneStatusNames.indexOf(statusName);
  87. // Get milestone details
  88. milestoneResponse = zoho.projects.getRecordById(portalId,projectId,"milestones",milestoneId,"milestonestatus");
  89. if(milestoneResponse.containKey("milestones"))
  90. {
  91. milestoneStatusId = milestoneResponse.get("milestones").get(0).get("status_det").get("id");
  92. }
  93. else
  94. {
  95. return "Couldn't update status of none milestone";
  96. }
  97. if(milestoneStatusId != milestoneStatusIds.get(indexOfReopen))
  98. {
  99. milestoneParameter = Map();
  100. milestoneParameter.put("milestone_ids",{"" + milestoneId + ""});
  101. milestoneParameter.put("update_fields",{"CUSTOM_STATUSID":"" + milestoneStatusIds.get(indexOfReopen) + ""});
  102. updateMilestoneDetails = invokeurl
  103. [
  104. url :endPointV3 + portalId + "/projects/" + projectId + "/milestones/" + milestoneId + "/updatefieldvalue"
  105. type :POST
  106. parameters:toString(milestoneParameter)
  107. connection:"milestonestatus"
  108. ];
  109. info updateMilestoneDetails;
  110. }
  111. }
  112. return "success";

Define a Workflow Rule:

After creating the custom function, define a task-based workflow rule. Set the trigger as "when task is updated" and associate the custom function under Add Action.



Once the workflow rule is triggered, the custom function will update the phase status automatically.

We hope you found this post to be helpful. If you have any questions, please leave a comment below or email us at support@zohoprojects.com.

    • Sticky Posts

    • Automation Series: Auto-update Phase Status

      Hello Folks! You can auto-update your phase's status based on status of underlying tasks using custom functions. In this series, we will showcase how to create and run custom functions, using Deluge, with ease. Follow the steps below and automate your
    • 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
      • Recent Topics

      • Introducing the all-new email parser!

        Greetings, We are pleased to introduce to you, a brand-new, upgraded version of the Zoho CRM Email Parser, which is packed with fresh features and has been completely redesigned to meet latest customers needs and their business requirements. On that note,
      • Zoho Projects - Refine Access to Collaboration Menu

        Hi Projects Team, I noticed that Calendar, Chat and Meeting menu options in the Collaboration section are visible to client users, even when they don't have access to the features. This could be confusing and frustrating, because if it's there you expect
      • Kaizen #217 - Actions APIs : Tasks

        Welcome to another week of Kaizen! In last week's post we discussed Email Notifications APIs which act as the link between your Workflow automations and you. We have discussed how Zylker Cloud Services uses Email Notifications API in their custom dashboard.
      • Login verification emails never received.

        I can't login to my account. You send a verification email, but it never arrives. This is a common problem, frequently caused by some relay point out there classifying the sender as a spammer. Is there anything I can do to bypass this? Maybe get a text
      • Extracting Images from a Zoho Creator Report into a Pages

        If you’ve uploaded images in a form and can see them in your report, you might also want to display those same images inside a Page (custom HTML page). This is useful for dashboards, profile pages, or any place where images should be visible dynamically
      • Zoho is blocking emails I subscribe to from one sender

        About 4 months ago I stopped receiving newsletters that I subscribe to from @thedispatch.com. They tell me that zoho's server is blocking them. I've added them to my contacts list, but they're not even reaching my inbox. I don't know how to troubleshoot
      • Unable to send message;Reason:550 5.4.6 Unusual sending activity detected. Please try after sometime.

        Please help my account got blocked automatically, can you help me how to avoid it? Thanks so much
      • Introducing Formula Fields for performing dynamic calculations

        Greetings, With the Formula Field, you can generate numerical calculations using provided functions and available fields, enabling you to derive dynamic data. You can utilize mathematical formulas to populate results based on the provided inputs. This
      • Inactive Items - Make Less Prominent by Default

        Currently, when one marks an Item as "Inactive", it really doesn't do much of anything to hide it or get it out of the way. Search and reporting within Finance should, by default, hide inactive Items from standard reports, searches, etc. If one specifically
      • Items should display under specific warehouse

        I have configured the multi warehouse but it show all the items under all warehouse which is not correct according to our business logic, so i want that items should only display under that specific warehouse not under all the warehouses not even with zero quantity. Some items should be common but not all so is there any option for that purpose so i can specific the items to its warehouse. Regards
      • How to calculate GST based on "Ship To Address"

        We into the interior designing work, providing "Works Contract Services" to our clients across India. We are registered under GST in Maharashtra state. For works contract services as per the GST rule, we need to decide place of supply based on "Ship to
      • I NEED TO NUMBER TO TEXT NO HERE

        =NUMBERTEXT NEEED
      • Auto-fill New Row with Previous Row Values

        rowsize = input.Order_Items.count(); for each row1 in input.Order_Items { rowsize = rowsize - 1; if(rowsize == 1) { row.Door_Model = row1.Door_Model; row.Door_Color = row1.Door_Color; row.Materials = row1.Materials;
      • When I click on PDF/PRINT it makes the invoice half size

        When I click PDF / Print for my invoice in Zoho Books, the generated PDF appears at half size — everything is scaled down, including the logo, text, and layout. The content does not fill the page as it should. Could someone advise what causes Zoho Books
      • Python - code studio

        Hi, I see the code studio is "coming soon". We have some files that will require some more complex transformation, is this feature far off? It appears to have been released in Zoho Analytics already
      • API question - adding a thread to an existing ticket

        Hi Is there an API function for the customer to add to an existing ticket thread? example, customer puts in new support ticket. support replies and ask for more details. customer replies with more details -what api function is used for this (will add record append to same ticket number?) Thanks
      • Why is Zoho Meeting quality so poor?

        I've just moved from Office 365 to Zoho Workplace and have been generally really positive about the new platform -- nicely integrated, nice GUI, good and easy-to-understand control and customisation, and at a reasonable price. However, what is going on
      • Items Below Reorder Point Report?

        Is there a way to run a report of Items that are below the Reorder Point? I don't see this as a specific report, nor can I figure out how to customize any of the other stock reports to give me this information. Please tell me I'm missing something s
      • Qwen to be the default open source Generative AI model in Zoho Desk

        Hello everyone, At Zoho Desk, we will make the latest Qwen (30B parameters) the default LLM for our Generative AI features, including Answer Bot, Reply Assistant, and others. As a subsequent step, we will discontinue support for Llama (8B parameters).
      • Calendar week view: Today + 6

        Is there anyway to have the calendar change dynamically based on the date? Due to the amount of events, we only display a week at a time, but towards the end of the week, we can no longer see ahead to next week (without changing it manually every time).
      • temporary system errorlouis

        J'essaye d'envoyer des mails avec mes 2 adresses mail qe nous avons sur le compte arthur@lepunch.fr et louis@lepunch.fr mais j'ai toujours le message temporaire system error, je reçois les mails mais impossible d'en envoyer a qui que ce soit
      • 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?
      • How to Cancel/Delete Queued Mail Merge?

        Hi. I just tried to do a mail merge before realizing there's a limit on number of sends. I accidentally sent one of my lists twice, and all of those emails are currently queued. Is there any way to cancel or delete a queued mail merge? Would love to be
      • 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
      • How to add to Subforms via Zapier with Zoho Writer?

        I have the following layout for a Zoho Writer Document. As you can see there is a repeating subform taking in "Items". I am trying to make a Zapier integration with it, and I can see there is 1 field saying: "Items", but it does not specify how I'm supposed
      • Contrôles administratifs granulaires : un atout pour la sécurité des e-mails

        La moindre erreur dans votre système de messagerie peut coûter très cher à votre entreprise, tant en argent qu’en conformité et en image de marque. Pour beaucoup d’organisations, ce risque est bien réel. Les e-mails véhiculent quotidiennement des informations
      • Marketer's Space: Why mobile optimization deserves a place in your email strategy

        Hello Marketers, Welcome back to Marketer's Space! Today, we'll talk about the importance of creating mobile-friendly email designs. While mobile phones were once used only to make phone calls, today they're used for almost everything, including texting,
      • Collections Management: #6 Realign Customers who gets back In-Term

        Arun stared at the subscription list on his dashboard. Another account had just been moved to Cancelled status after completing the whole dunning process. Nothing unusual, just that payment failures happen, retries fail, and cancellation is the expected
      • Zoho Mail IP Blacklist

        I need problems with send mails: Error: junk mail rejected - sender4-op-o10.zoho.com 136.143.188.10, is in RBL. Spamcop. Please remove FQDN for blacklist. Regards.
      • I can receive but not send emails

        Hello, I've been not able to send emails for almost a year now. I been using alternate email to do this. I want to know how to fix this so I can use my zoho account normally again.
      • The challenge of 24/7 connectivity: Being present and meeting customer expectations

        Before television entered our homes, radio was our window to the world. We had to tune carefully to catch voices from distant places. When television arrived, the world began to grow smaller. We can watch rocket launches, see the goal that wins our favorite
      • How to download all attachments from inbox, send, other folders in one go

        Hi All, Appreciate if anyone could help me with steps for below requirement. How to download all attachments from inbox, send, other folders in one go. Even mapping to new folder will help me. Thanks in advance.
      • Cannot connect mail accounts to Thunderbird

        Hi Support - I'm attempting to add my mail accounts to Thunderbird but I'm getting an unable to login to server error. I tried to use the password associated with my account I received the unable to login error. So I went into Zoho Accounts and generate
      • Alias Email Id already exists

        Hi, I just verified my domain sesque (dot) com and now I am trying to create the admin account using admin (at) sesque (dot) com, but I am getting an error saying "Alias Email Id already exists". I used to have another Zoho account with this email address,
      • Unable to connect to smtp server, connection timed out

        Hi Team, I am facing below issue, while sending out emails from thunderbird client. It used to work, facing this issue from morning. Error: Sending of the message failed. The message could not be sent because the connection to Outgoing server (SMTP) smtp.zoho.com
      • javax.mail.authenticationfailedexception 535 authentication failed

        Hi, I am facing 535 authentication failed error when trying to send email from zoho desktop as well as in webmail. Can you suggest to fix this issue,. Regards, Rekha
      • 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
      • Zoho Creator customer portal users

        Hi, I'm in a Zoho One subscription with our company. I'm running a project now that involves creating a Zoho Creater application and using the Zoho Creator Customer Portal.  At most we need 25 customer portal users. In our Zoho One plan we only get 3
      • DKIM Verification Failed (Namecheap)

        Hi! I have already set up the TXT records in Namecheap but I keep getting the "Verification Failed" pop up. Was wondering if I'm the only one who has this problem and can anyone help me with this? Thanks!
      • Emails stuck in Queue

        Hi there, Since yesterday I have a few out going emails stuck in a queue. It say it will auto retry sending however nothing is happening. It seems to be affecting roughly 50% of my outgoing emails. Please help Thanks
      • Next Page