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

    • How Do I Refund a Customer Directly to Their Credit Card?

      Hi, I use books to auto-charge my customers credit card. But when I create a credit note there doesn't seem to be a way to directly refund the amount back to their credit card. Is the only way to refund a credit note by doing it "offline" - or manually-
    • Zoho Learn Course Completion Notifications/Triggers/API

      Zoho Learn works great and will suit our course creation needs, but it appears to be lacking a bit when it comes to integration with other Zoho services (creator etc.) when it comes to course completion. 1) Is there an API or Zoho Flow trigger for when
    • Enhanced Recording Permission Controls for Zoho Cliq Meetings (Similar to Zoom)

      Hello Zoho Cliq Team, We hope you are doing well. We would like to request an enhancement to the recording permission functionality in Zoho Cliq Meetings. Current Limitation: in Zoho Cliq Only hosts and co-hosts can record a meeting. Participants cannot
    • Phone Connection

      When on a call the person on the other end complains that there is static, I am cutting in and out or they can't hear me all. This happens on the cell connection as well.
    • Can't add a sender adress from zoho campaigns

      hi, I need to change the sender address for a campaign.  When i try to add it i get a message to say 'duplicated email address found while adding your sender address'.  This is the first campaign i'm sending so I don't understand why this message is displayed? Thanks Jane 
    • Allow customers to choose meeting venue and meeting duration on booking page

      My business primarily involves one-to-one meetings with my clients. Given the hybrid-work world we now find ourselves in, these meetings can take several forms (which I think of as the meeting "venue"): In-person Zoom Phone call I currently handle these
    • Painfully Slow Zoho mail

      Since yesterday Zoho Mail seems to have starting functioning very slowly and having a few bugs. It's slow to open mails, slow to send, slow to change between email accounts. Sometimes clicking on a particular folder (eg Sent folder) stops working and
    • Export History timeline

      Hi, I have an idea, bout zoho desk history of the ticket it would be great if the agent or admin of the zoho desk can export the timeline of the ticket history for agent report or on other matter.
    • Desk fails to create a new ticket on Reply email

      When I send a direct email to support@mysite.com, Desk will create a new ticket as expected. When I REPLY to an email sent from support@mysite.com, Desk will NOT generate a new ticket. This is very bad. How can I fix this? Use case: In a separate system
    • Ask the Experts 25: Experience the full spectrum of Zoho Desk’s autumn and spring releases for 2025

      Hello Everyone, We’re on the 25th episode of our ATE series! It's a true milestone in our live community interactions! It’s been an amazing journey since we started in October 2018. Zoho Desk has come a long way, evolving with the support of a wonderful
    • Addin Support in Zoho Sheet

      Is there any addin support available in zoho sheet as like google marketplace to enhance productivity by connecting with other apps, providing AI data analysis, streamlining business processes, and more?
    • Function #61: Automatically add free item to the invoice based on item quantity

      Hello everyone, and welcome back to another Custom Function Friday! During holiday seasons or special promotions, businesses offer deals like BOGO (Buy One, Get One), Buy 3 Get 1 Free, Buy 2 at 50% off, and much more to attract customers. These promotions
    • Notes for Items for Future Purchase Order

      Next time when I order an item, tau have to make some changes in it, that order has to be placed after 4-5 months, I want to save those changes or points somewhere in the item, how will that be possible..
    • Schemes of different tyoe

      How can easily apply hourly, day wise or month wise  schemes on Bill, Quantity, and other schemes. Like I want to apply a scheme  Form today to next 7 days .where i can mention in zoho books so scheme will implement automatically to all customers and
    • Clients not receiving emails

      I've been informed that my emails are not being received. Is there anything that I should look into to rectify this? Many thanks!
    • Free Plan mail accounts details

      In the zoho mail pricing there's a free plan that includes: FREE PLAN Up to 25 Users 5GB* /User, 25MB Attachment Limit Webmail access only. Single domain hosting. I need to make sure that I'm able to create multiple email accounts in the form of: name@domain.com
    • No more IMAP/POP/SMTP on free plans even on referrals with NO NOTICE

      Outraged. Just referred a colleague to use her domain (not posting it publicly here) to Zoho, just as I have other colleagues, clients, friends. Expected the exact same free plan features as I have and as everyone else I ever referred got. I was helping
    • Unable to receive email - "5.3.0 - Other mail system problem 554-'5.2.3 MailPolicy violation Error delivering to mailboxes'"

      My users are unable to receive emails from one particular domain, apparently. The domain known to be kicked back is whitelisted in the spam control. I sent an email to support earlier this morning but I have not received a reply. The error in the title
    • Caixa de saída bloqueada. Como desbloquear?

      Olá, meu e-mail isabela.celli@sivirino.com está com a caixa de saída bloqueada. Não consigo enviar e-mails. Acredito que tenha sido porque mandei o mesmo e-mail para várias pessoas, pedindo uma cotação de serviço. Vocês podem desbloquear para mim? Quantos
    • Zoho Forms - Improve the CRM integration field to query data from more than one module

      Hi Forms team, Something I get stuck on regularly is pre-populating a form with data when that data is spread across 2 or 3 modules. For example Contacts, Accounts and Deals. I don't want to duplicate the information in CRM so I end up writing a function
    • desbloquear cuenta

      Buenos dias  Cordial saludo Tengo una cuenta libre en zoho mail asociado a un dominio, pero uno de los usuarios se bloquea el correo porque dice que ha excedido el límite de correo, por favor podrian desbloquearla y como hago para que esta persona debe enviar sus correos sin ningun probleama. Gracias de antemano
    • Not Receiving Incoming Mail

      I can send emails from my account but I do not receive any. I originally set up forwarding and it worked for a while and then stopped. I turned off forwarding and now do not receive any emails. Could you please check what is causing this issue? Thank you
    • Will zoho thrive be integrated with Zoho Books?

      title
    • BARCODE PICKLIST

      Hello! Does anyone know how the Picklist module works? I tried scanning the barcode using the UPC and EAN codes I added to the item, but it doesn’t work. Which barcode format does this module use for scanning?
    • Making preview pane "stick"

      Hello, Is it possible to fix/dock the preview pane so that it's always there? The modern monitors are all very wide so there's plenty of space horizontally. Having the preview pane disappearing and appearing again when you click on an email message in
    • Reason:554 5.1.8 Email Outgoing Blocked

      I have been struggling to set up my email address for some time now; it's difficult to locate what I need. Additionally, I cannot send or receive any emails. I keep receiving the "Reason: 554 5.1.8 Email Outgoing Blocked" error. There doesn't seem to
    • Trouble Connecting Zoho Mail via IMAP in n8n – Need Help

      Hi everyone 👋, I'm trying to connect my Zoho Mail account to n8n using the IMAP Email Trigger node, but I'm facing issues getting it to work fully. ✅ Here's what I’ve done so far: ✅ IMAP access is enabled in my Zoho Mail settings ✅ I’m using the correct
    • Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked

      Hi, I sent few emails and got this: Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked And now I have few days since I cant send any email. Is there something wrong I did? Also can someone fix this please
    • Changes to the send mail Deluge task in Zoho CRM

      Hello everyone, At Zoho, we continuously enhance our security measures to ensure a safer experience for all users. As part of our ongoing security enhancements, we're making an important update on using the send mail Deluge task in Zoho CRM. What's changing?
    • Page Rules in Forms

      🚀 Dynamic Page Navigation Implementation I successfully implemented dynamic page navigation based on a user's radio button selection. The goal was to direct users to a specific, corresponding page while ensuring they only interact with the flow determined
    • Cancellation of written-off invoice

      Hi, Can I know when we cancel the write off (write back), in which FY, the reversal is recorded. It doesn't ask as to when the write off should be cancelled to reflect!. It shouldn't reflect in the year in which the invoice was written off since the Year
    • Create Invoice automated with Package

      Does anyone knows how to create an invoice from a SO when we have created the package? We do these manually. and validate that the product packed is the product invoiced (if the order is partially packed) Regards, JS
    • I want to create a mailing list, NOT a group.

      Can I create a mailing list in Zoho mail? I just want to be able to make a list of email addresses and give the list a name. Then when I type the list name, the list of email addresses will be automatically listed. When I create a group it sends an email
    • ERROR CODE :554 - Your access to this mail system has been rejected due to poor reputation of a domain used in message transfer

      This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. *****, ERROR CODE :554 - Your access to this mail system has been rejected due
    • Export Invoices to XML file

      Namaste! ZOHO suite of Apps is awesome and we as Partner, would like to use and implement the app´s from the Financial suite like ZOHO Invoice, but, in Portugal, we can only use certified Invoice Software and for this reason, we need to develop/customize on top of ZOHO Invoice to create an XML file with specific information and after this, go to the government and certified the software. As soon as we have for example, ZOHO CRM integrated with ZOHO Invoice up and running, our business opportunities
    • no me llegan los correos a Zoho mail

      No puedo recibir correos pero sí enviarlos, ya hice la modificación de MX y la verificación de teléfonos, qué es lo que ocurre? gracias
    • Group Calendar as Default for adding new events, etc?

      Hi, I want to make the group calendar (that I created, if that makes a difference) the default for anything new I add to the calendar. How can I do that? thanks.
    • Bookmark Loading is Buffering

      Hi, i clicked on the bookmark tab, around yesterday and since then it's been constantly buffering and doesn't allow me to access the mail's i have tried login in and out but of no help also trying to share a screenshot of the issue around 232 kb size,
    • Zoho Webinar custom registration fields into Zoho CRM

      I am pushing webinar registrations into zoho crm as leads and this is working fine. I have added a few custom fields to my webinar registration and I wish for these fields values to get mapped into the resulting CRM lead record. I am not seeing anywhere
    • GitLab Extension for Zoho Desk: Connecting support and development for faster resolutions

      Hello everyone! We’re excited to introduce the GitLab Extension for Zoho Desk, an integration that bridges the gap between support and development teams. This allows tickets to be converted into actionable GitLab issues for faster resolutions, better
    • Next Page