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

      • Pause(1);

        I'm using scheduler to invoke an interaction via http post with an external service. The schedule code uses a for-each loop that runs so fast my external application's log files get messed-up (they are named by date-time stamp). What I'm suggesting is
      • Integration Request: Elementor

        Integrating Zoho CRM forms with Elementor, the most popular page builder on Wordpress, would be great. I use it for our site, goenergylink.com, and I have had to use Zapier webhooks to be able to connect it with Elementor. The one issue I have run into
      • Ability to Change Visibility of Published YouTube Videos

        Hi Zoho Social Team, How are you? We would like to request an enhancement in Zoho Social regarding the management of already published youtube videos. Currently, after publishing a youtube video through Zoho Social, there is no option to change its visibility
      • Adding anchor links in Zoho CRM email templates

        I know you can add anchor link in Campaigns, but I dont see the option to that in the CRM email template. Am I missing something?
      • openUrl in blueprints

        My customer wants to open a URL at the end of a blueprint transition. Seems this isn't possible right now but it would be very useful. In this thread, https://help.zoho.com/portal/en/community/topic/openurl-not-working the Zoho agent said that it's logically
      • Ability to Add YouTube Video to Playlist During Publishing

        Hi Zoho Social Team, How are you? While publishing YouTube videos through Zoho Social, we noticed that the platform currently does not allow selecting a playlist at the time of publishing. Instead, we can only add the video to a playlist after it has
      • Introducing Zoho Creator's 2025 Release Projection 2

        Hello Creators! I'm Prakash, from the Creator product management team, and today I'm delighted to unveil our next set of features as part of Release Projection 2 for 2025. With thoughtful analysis and planning, we've curated powerful new capabilities
      • Sharing Form Ownership Among Multiple Users

        I would really like the ability to share form ownership among multiple users. It's frustrating to me that if a co-worker wants to make an edit to a form, I have to transfer ownership to them. It would be great if forms could act like google forms, where multiple people can edit a form and view responses. 
      • Marketer’s Space - Ace Your Spooky-Season Marketing with Pre-designed Templates in Zoho Campaigns

        Hello marketers, Welcome back to another post in Marketer’s Space! We’re in Q4, which means that you have endless opportunities to connect with your audience, starting with Halloween campaigns! In this post, we’ll show you how to design the perfect Halloween
      • Zia expands to China with native features and DeepSeek-powered generative AI features

        Hello everyone, We are glad to support Zia native features and Zia generative AI features for our customers in China. From hereon, all AI-features in Desk will be accessible in China data center with the integration of DeepSeek generative AI model. DeepSeek
      • Email in each module

        We have a contact ,module which then has a link to customer assets which in turn the asset has a multiple link to service visits. When we link assets to customers we choose by name and it brings over the associate email via the lookup. Great feature.
      • Global Search placement in the new UI

        Having a hard time with the global search placement in the UI redesign. Surely I can't be the only one. Previously global search placement was perfect. A bar at the top/center of the page. Exactly where you would expect it to be. Since the new UI has
      • Introducing Skill-Based Ticket Assignment

        The goal of every support team is to provide great support, and to do so as fast as they can. To make this possible, it is important that agents spend their time judiciously, especially when they're dealing with a large number of tickets of varying urgency
      • Kaizen #213 - Workflow APIs - Part 1

        Welcome to another week of Kaizen! If you have ever managed complex business processes, you know that Workflows are the quiet backbone of any well-run business process. They keep things moving; assigning owners, sending alerts, keeping deals on track,
      • Browser and address bar hide

        Hi, How i can do hide the address bar with browser headline when i am working on the sheet, because i am using (freeze panes) which i want visible for full work. For your reference here i am attached the screen shot and marked yellow lines which really
      • Cells Border

        Hi I am using Zoho Sheet on S Tab , is there any option to make all border of any cell at once. I think this is very basic which we are missing. This is available in mobile but not in tab or suggest if i am missing this function. And for Tab can you give
      • Credit Management: #2 Configuring Right Payment Terms for Credit Control

        Think about the last time you ordered something online and saw that little note at the checkout, "Pay on Delivery" or "Pay later". It's simple, but it actually sets the tone. As a business owner, you know exactly when payment is expected. Now, imagine
      • Zobot and Sales IQ

        What will happen to the Zoho Sales IQ being integrated to the website after creating the Zobot on the website too
      • Help Center and SEO: Any Benefit to My Domain-Mapped Website Ranking?

        First of, I love the Help Center which I've just decided to integrate into my website to replace its old-fashioned FAQs. So much more to achieve there now! Lots of new benefits to the site visitors and to me in terms of organizing and delivering all the
      • Support french language options

        Greetings, I want to use Zoho with the french language portal, however the supplied translation is not very good (google translate). There are many basic mistakes on the main most important sections (my requests, submit a request). Is there a way for
      • Automation #7 - Auto-update Email Content to a Ticket

        This is a monthly series where we pick some common use cases that have been either discussed or most asked about in our community and explain how they can be achieved using one of the automation capabilities in Zoho Desk. Email is one of the most commonly
      • Introducing the Workflow and Actions APIs for Zoho CRM

        We are absolutely thrilled to announce the release of Workflow APIs and Actions APIs in Zoho CRM’s v8 API suite! This powerful new set of endpoints gives developers unprecedented programmatic control over business automation. For years, Workflow Rules
      • Zoho CRM Analytics - Allow To Reorder Dashboards

        I would like to suggest that you add the ability to reorder dashboards in the Analytics Module. I can see that this has been requested some time ago, the latest 9 years ago. I am not sure if this is a big or small endeavor, but such a small fix can go
      • Zoho Form URL displays incorrect name

        Hi, I have a form I created called "Design Request form". It displays this way everywhere I look. However, in the URL, it shows up as "DesignJobRequestFormFINAL011325PROOFV1B" and I'm not sure why. I can't find where to fix this. Does anyone have any
      • Consumers are talking about your business. Are you listening?👂

        A loyal customer might be praising your product in a forum. A frustrated user could be posting a harsh review on a public site. An excited partner may have left a comment on your campaign. A domain expert might be deconstructing your product. A prospect
      • What counts as a Temp for Billing Purposes in Workerly

        I'm considering trying this product but am not sure how the temp count is used for billing purposes. For example, if we keep a large data base of 500 potential workers.....are we billed for that or only if they are assigned to a client at a given point
      • Cold emails not allowed?

        I planned to use Zoho Mail to send businesses some cold emails to offer my freelance writing services, but I noticed that the anti-spam policy is very strict -- no commercial emails whatsoever without prior permission from the recipient? I would be very
      • Form name incorrectly displayed in URL

        Hi, I have a form I created called "Design Request form". It displays this way everywhere I look. However, in the URL, it shows up as "DesignJobRequestFormFINAL011325PROOFV1B" and I'm not sure why. I can't find where to fix this. Does anyone have any
      • I can't receive mail

        Hello, I can't receive e-mail. I no longer receive e-mails to the e-mail I received for ​my site. I also edited the DNS settings, but it doesn't work at all.
      • 1‑to‑1 invite missing post-setup (needs re-invite) vs channel invite auto-joins without business prompt

        1. Zoho Cliq 1‑to‑1 external invite The inviter sent a 1‑to‑1 invite to an invitee who didn’t have a Cliq account. After the invitee completed account setup and created a business/organization, the website redirected them to Cliq, where they opened Cliq
      • 【開催報告】東京 ユーザー交流会 Vol.3 2025/10/17 Zoho サービスの活用促進を外部ツールとの連携で実現!

        ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 10月17日(金)に新橋で「東京 ユーザー交流会 Vol.3」を開催しました。ご参加くださったユーザーの皆さま、ありがとうございました! この投稿では、当日のセッションの様子や使用した資料を紹介しています。残念ながら当日お越しいただけなかった方も、ぜひチェックしてみてください😊 ユーザー活用事例セッション:Zoho Flowと決済システムの連携 あみろくの岡島さんに、Zoho サービスの活用事例として、Zoho Flow を活用した外部サービスとの連携事例をご共有いただきました。
      • received email opens in a new tab every time I log in

        as per the title: since about when I first made my email account, every single time Ive logged in to view my inbox, a new tab opens for an email I viewed once as if restoring a closed session. I thought I just didnt understand the "starting up" settings
      • Engage with your customers at scale using WhatsApp Marketing Template messages

        Hi everyone, To make it easier for organizations to communicate with customers, Desk now allows you to send individual, mass, and bulk WhatsApp template messages from both the Ticket and Contact modules. How is this going to benefit your business? WhatsApp
      • Importation Tickets error

        Hi, I'm newbie here 🤓 So, i'm importing data from csv, but when I try advance to mapping fields the importer tool show this message: Previously I try import, other data, and not show errors in this step. Some ideas? Best Regards,
      • Showing description in timesheet and timelogs.

        I am wondering if it’s possible in version 5 of Zoho People to have the description show by default or with a manipulation on the user’s part. Let me show you what I mean. As you can see this is the view for the users. Now if they want to see the full
      • Workaround: openURL in Blueprints - An alternate approach

        There is a roundabout way to open a URL in blueprints after a save event. By using the 'onBeforeMandatoryFormSave' in Client Script, you can open an external URL. Now, the problem is, this is designed to be run BEFORE the blueprint is saved, not after,
      • MTD SA in the UK

        Hello ID 20106048857 The Inland Revenue have confirmed that this tax account is registered as Cash Basis In Settings>Profile I have set ‘Report Basis’ as “Cash" However, I see on Zoho on Settings>Taxes>Income Tax that the ‘Tax Basis’ is marked ‘Accrual'
      • Migrate file from Single File Upload to Multi File Upload

        Dears, I have created a new field Multi File Upload to replace the old Single File Upload field. I'd like to ask you guys what is the best way to migrate the files to the new field?
      • Open "Live Chat" from a hyperlink?

        Hi, I often write paragraphs and text on our company website, and usually say you can get in touch with us via live chat. Can the chat window be triggered to pop open without clicking the chat graphic in the bottom window, and use it in a hyperlink? ie:
      • Zoho Sites search box

        Is there a Search box that can be added to a Zoho site? It would be for searching within the site only.
      • Next Page