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

      • Update on the client portal URL for Guest users

        We’re updating the way Guest users access their Connect network. As part of this change, all client organization portals used by Guest users will now be accessible through a dedicated domain specific to each data center. The access URLs mentioned here
      • Preserve Ticket Issue Mapping When Migrating from Jira to Zoho Projects

        Hello Zoho Projects Team, We hope you are doing well. We are currently exploring a full migration from Jira to Zoho Projects, and we identified a critical limitation during the migration process involving Zoho Desk integration. Current Situation: We use
      • Unable to see Zoho contacts in Zoho app on ios

        Hi Support Team, I am a new user, I have created my account and installed zohomail app on iOS 16 which works. I was also able to import my Gmail contacts into Zoho Contacts, which I can see. The problem is that I can’t see these imported cobalts in Zohomail
      • Task Due Date greater than 10 years.

        We use recurring tasks in Projects where every week, month, year etc Some of our projects are greater than 10 years and we are unable to set a new due date because the difference between start date and due date is greater than 10 years. As an example
      • External User onboarding for zoho connect is not really intuitive.

        So the external user is sent an invite, which has a button that directs them to login to zoho to view the invite, but if they don't have a zoho account, they cannot access that invite, which seems kinda silly, as there is not real way on for them to create
      • Hosting external websites on Zoho?

        How can I host my external website on zoho? Do we have that option? I am currently with hostinger and am looking to switch to zoho. Kindly help. Thanks.
      • How to Add Time Formula Duration (hh:mm)

        Hi everyone — I’m trying to create a formula field in Zoho CRM that calculates the difference between a “Call Start Time” and “Call End Time” and displays the duration in HH:MM format (for example: 1:04 for one hour and four minutes). My current setup
      • How can I calculate the physical stock available for sale?

        Hey Zoho Team,  I've tried to calculate the physical stock on hand in various ways - but always receive a mismatch between what's displayed in Zoho Inventory & analytics.  Can you please let me know how the physical stock available for sale is calculated?
      • Set Custom Icon for Custom Modules in new Zoho CRM UI

      • Marketing Tip #4: Build your email list early

        Email marketing has one of the highest returns on investment. Don’t wait until later; start collecting subscribers now. When you've got their attention, you can send them emails about offers, new product launches, seasonal greetings, and more. Try this
      • Is anyone else having trouble saving a custom image in their email signature, or is it just me?

        When I try to save the image I get an error that says "Operation Failed" I opened a support ticket two weeks ago and received a response that it would be debugged, but it still isn’t working
      • Unify Overlapping Functionalities Across Zoho Products

        Hi Zoho One Team, We would like to raise a concern about the current overlap of core functionalities across various Zoho applications. While Zoho offers a rich suite of tools, many applications include similar or identical features—such as shift management,
      • Zoho Desk Domain mapping / Cloudflare CNAME not recognized

        Hello, my website is behind Cloudflare and SSL. From the Cloudflare control panel I added a CNAME record such as support.mydomain.com pointing to desk.cs.zohohost.com but I'm stuck with the message "Make sure you've mapped the CNAME entry..."
      • Create an Eye-Catching Announcement Widget for Your Help Center

        Hello Everyone! In this week’s edition, let’s explore how to keep your customers updated with exciting news in the Help Center. See how ZylkerMobile wowed their customers by bringing updates right to their portal. ZylkerMobile, the renowned brand for
      • I want to add my other zoho account in same pc

        why does zoho restrict me doing many things as i also want to add my second mail account bit its not allowing me to do that
      • Search in Zoho Community Not Working

        I realize this is a bit of a meta topic, but the search for the various Zoho Communities appears to not be working. I'm under the impression that they run on some version of the Zoho Desk platform, so I'm posting this here.
      • Capture Stripe’s Customer ID

        Does anyone know of a way to capture Stripe’s customer ID that is created when the form/payment is processed? I would like to have the customer ID stored in our CRM so we could utilize in some custom functions down the road.
      • Custom Modules - Where are Comments??

        In the standard ticket module and in the tasks module, we have an interactive comment box that we can post important details/notes and can tag others if needed. Where is this functionality for Custom Modules? Ideally, custom modules would have very similar,
      • Zoho Mail will not set up in Thunderbird

        I am using Thunderbird 13.0.1 in Linux Mint 13 64-bit.  I cannot set up my Zoho IMAP email in this client.  This is evidently a common problem as evidenced by these postings in the Thunderbird forum: thunderbird can't seem to "find the settings" I cannot configure it for my zoho.com email account I can not get ZOHO to configure. Any suggestions? The best T-bird seems to be able to do is to refer these users to the Zoho forum. I believe the instructions in the Zoho help wiki are correct, although
      • Zoho ShowTime: Certificates of Completion - Award your learners with a sense of achievement

        In our increasingly competitive market, professional trainers need to differentiate themselves if they are to survive. One way to do this is to focus on innovation and deliver an ideal learning experience. By developing a renowned certificate program that provides learners with a specialized skill set for a particular industry, both trainees and future prospects will recognize the trainer's leadership in that field. This can help with long-term growth, revenue generation, and even marketing and branding.
      • IMAP Migration from Gmail

        I have been trying to import my email from a Gmail server and keep receiving the following error. I have reduced the security, activated imap and no improvement. The link to the Google support item has not helped. Unable to connect to your account. Please
      • Your Incoming has been blocked and the emails will not be fetched in your Zoho account and POP Accounts Click here to get unblocked.

        When entering my account, this error is thrown at me, and I deleted a good part of my deleted messages, but I still can not unblock it, I would appreciate your help. reservas@lineasperutravel.com
      • Request for Creating Multiple Email Accounts on One Mobile Number

        Dear Zoho Team, I am planning to shift all my work-related communication to Zoho Mail because of its reliability and features. For my work, I need to create 3–4 separate email accounts for different purposes. Could you please confirm if it is possible
      • Signature issue

        Problem: The signature does not appear when replying or forwarding an email. solve issue: settintgs/Signature Check option place a signature above the content with quotation marks
      • mail admin not loading

        i am trying to login to mailadmin ... gears keeps rotating forever... its not a password issue whats so ever ... not cookies issues whatsoever from android app i can login but there so few things to do from there .. i changed ip address the same... i
      • Unify All Zoho Video Meeting Experiences into One Standardized Platform

        Hi Zoho Team, We would like to share an important user experience concern regarding the current state of video meeting functionality across the Zoho ecosystem. The Problem Within Zoho, there are multiple ways to initiate or schedule a video meeting: Zoho
      • Changing Account in Quote form does not update address information.

        I am trying to update the address information in a quote I've created. I corrected the address in the "Account" but that did not change in the quote. If I re-enter the Account Name in the Quote form, nothing updates. How do I fix this?
      • Zoho One Backup of entire account

        Hello, When using Zoho one is there a way to backup your entire account of all apps that you are using \ activively using in a single step or do you have to backup each applications data individually? Thanks,
      • Issue with “CC” and “Subject Details” of the initial mail when reply / replied all / forward using Zoho Mail Client (Desktop / Web Mail / Mobile App)

        It is observed that when I reply / reply all / forward a mail using Zoho Mail Client (Desktop / Web Mail / Mobile App), the “CC” and “Subject Details” are omitted from the mail which was replied/forwarded. However this is not the case with outlook mail
      • Unable to send Emails - 452 4.3.1 Temporary System Error

        Whene ever i request smtp server to send the email (without attachment). i recieve error "452 4.3.1 Temporary System Error"
      • I can't receive email

        I cannot receive any email sent to my Zoho email after the free upgrade plan trial is finished.
      • Help for the alisa adding

        Sorry, I would like to add a paypal alias on my domain email address. However, the system blocked it. How can I do it?
      • Lite plan attachment said 250mb but actually 25mb ?

        Lite plan attachment said 250mb but actually 25mb ? I can't attach over 25mb files, and can't receive mails has attached files over 25mb too
      • Any update on much requested feature, to delete attachments without deleting the e-mail body?

        People have been requesting the ability to delete e-mail attachments without deleting the e-mail for more than ten years now. The latest I see is marked "Working On It" and a year ago it was supposedly being added, see here: https://help.zoho.com/portal/en/community/topic/is-there-a-way-to-delete-mail-attachments-without-deleting-the-text
      • Old vs New Value for Deleted Lookup Values

        Suppose the following scenario, where a value in a lookup is deleted: 1. User has countries form 2. Form A has a lookup to countries form 3. User selects Italy in Form A and saves it with the Italy ID 4. Form A report shows Italy 5. Italy is inadvertently
      • Zoho email using a python or html template

        # main.py import smtplib import csv from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from config import SENDER_EMAIL, APP_PASSWORD, SMTP_SERVER, SMTP_PORT # email Subject email_subject = "🎉 Python + Zoho Mail HTML Email
      • customize payment page

        Is there a way to customize, other than the theme colour, the payment page that customers are taken to from invoices? I can't seem to find a way. I just don't like the formatting of the current page and would like to make it look better. I've looked at
      • Solution: How to send email using a python follow up this

        # Step One Setup Your App Password For this url {https://accounts.zoho.in/home#security/app_password} #How to genarate App password {https://help.zoho.com/portal/en/kb/bigin/channels/email/articles/generate-an-app-specific-password#To_generate_app_specific_password_for_Zoho_Mail}
      • Are Environments Worth It?

        In concept, Environments in ZC is a great idea. I think the flow is pretty smart when you compare it to GitHub, especially for a low code audience. However, in practice, I've found it to be unpredictable, and I've only used it a few times. Aside from
      • Enhanced duplicate check for Leads in CRM

        Hello Everyone, We are excited to announce that you can now check for duplicate entries in leads by comparing them with similar records in the Contacts Module. Previously, when you added a lead, only the converted leads were checked for duplicates. This
      • Next Page