Power of Automation :: Auto update the Project status based on the count of completed Milestones

Power of Automation :: Auto update the Project status based on the count of completed Milestones

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. 


Let us consider the below use case - 


The status of a Project should be automatically updated based on the count of milestones that are completed in that project. Below should be the status of the project according to the count of completed Milestones.


Yet to Initiate → When no milestone is completed.

In Progress → When at-least one milestone is completed.

Completed → When all the milestones are completed.

 

We had accomplished this requirement using Custom functions.


Create a connection for Zoho Projects service with the scopes “ZohoProjects.portals.READ, ZohoProjects.projects.ALL, ZohoProjects.milestones.READ” to replace ‘projects’ with the connection name. Click this link below to learn how to create the connection. 

It is possible to automate this process by associating the custom function to the Task Workflow Rules. Attached the screenshots of Task workflow rule & Arguments.


Script to be used ::

projectsEndpoint = "https://projectsapi.zoho.com/restapi/portal/";

param = Map();

param.put("status","completed");

getMilestones = invokeurl

[

url :projectsEndpoint + portalId + "/projects/"+ projectId +"/milestones/"

type :GET

parameters:param

connection:"projects"

];

// info getMilestones;

statusName = "";

if(getMilestones == "") {

info "No milestones completed";

statusName = "Yet to Initiate";

} 

else if (getMilestones.contains("milestones")) {

completedMilestones = getMilestones.get("milestones").size();

info "Completed Milestones : "+completedMilestones;

if(completedMilestones==1) {

statusName = "zp.projstatus.inprogress";

}

else {

param = Map();

param.put("status","notcompleted");

getNotCompletedMilestones = invokeurl

[

url :projectsEndpoint + portalId + "/projects/"+ projectId +"/milestones/"

type :GET

parameters:param

connection:"projects"

];

if(getNotCompletedMilestones=="") {

statusName = "zp.projstatus.completed";

} else {

notCompletedMilestones = getNotCompletedMilestones.get("milestones").size();

info "Not Completed Milestones : "+notCompletedMilestones;

}

}

}

info statusName;

/* Project status update  */

if(statusName!="") {

projectDetails = invokeurl

[

url :projectsEndpoint  + portalId + "/projects/" + projectId + "/"

type :GET

connection:"projects"

];

// info projectDetails;

info "-------------------------------------";

statusMap = Map();

if(projectDetails != null && projectDetails.get("projects") != null)

{

projectDetail = projectDetails.get("projects").get(0);

layoutDetails = projectDetail.get("layout_details");

projectLayoutId = layoutDetails.get("project").get("id");

info "projectLayoutId: " + projectLayoutId;

projectLayoutDetail = invokeurl

[

url :projectsEndpoint + portalId + "/module/projects/layouts/" + projectLayoutId + "/"

type :GET

connection:"projects"

];

if(projectLayoutDetail != null && projectLayoutDetail.get("customstatus") != null)

{

projectStatus = projectLayoutDetail.get("customstatus");

for each  status in projectStatus

{

statusMap.put(status.get("status_name"),status.get("status_id"));

}

}

info "statusMap : " + statusMap;

info "------------------------";

if(statusMap.containKey(statusName))

{

updateProjectParamMap = Map();

updateProjectParamMap.put("custom_status",statusMap.get(statusName));

projectDetail = invokeurl

[

url :projectsEndpoint + portalId + "/projects/" + projectId + "/"

type :POST

parameters:updateProjectParamMap

connection:"projects"

];

// info projectDetail;

// info "-------------------------------------";

}

}

}

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

      • 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,
      • Schedule Exports for Regular Project Updates

        Tracking project data often means exporting data at regular intervals. Instead of manually exporting data every time, users can schedule exports for Phases, Tasks, and Tasks in Zoho Projects. These exports can be set to run once, daily, weekly, or monthly
      • Set Custom Business Calendars and Holidays for Global Teams

        Managing a project across diverse teams means accounting for more than just tasks and deadlines; it means acknowledging how and when each team actually works. Users might follow different working days or observe region-specific holidays that cannot be
      • Restore Trashed Records Anytime Within 30 Days

        Access the recycle bin from the Data Administration tab under the settings page in Zoho Projects, which gives better control over the trashed data. When records like projects, phases, task lists, tasks, issues, or project templates are trashed, they are
      • Organize and Clone Task Custom Views

        We have rolled out two new enhancements to task custom views: Custom View Groups and Custom View Clone. Custom View Groups Similar to predefined view groups, we have introduced groups for custom views to help organize and categorize them. My Custom Views:

        • Recent Topics

        • SalesIQとPageSenseの利用について

          初めての投稿で場違いだったらすいません。 弊社ではSalesIQを運用しているのですが、追加でPageSenseの導入もしたいと現場からの声があります。 両サービスともクッキー同意バナーが必要なサービスなのですが 弊社では同意無しに情報はとりませんという方針なので 2つ入れると2つバナーを出す必要がでてきます・・・ 両サービスを運用されてる方があれば運用状況とか教えてほしいです。 PageSenseについては詳細まで機能を理解してないなかでの質問です。
        • How to integrate Zoho Forms with Zoho CRM on Standard Plan

          Hello Zoho Support Team, I am using the Standard Zoho Forms plan (USD 30/user) and I would like to integrate Zoho Forms with Zoho CRM so that certain fields in my forms can be automatically prefilled using data from Deals in CRM. Specifically, I want
        • CRM : Function to add user name to text field

          I have a lookup field in a module that is linked to the CRM users so we can assign a Project Lead to the customer. Sadly Zoho Marketing Automation doesn't sync Lookup fields so I need to extract information from the lookup to text fields: Lookup field
        • Export PDF File Name

          Is it possible to change the default Zoho .pdf naming scheme for inventory items like quotations? Would like to use the the Subject as the default quote name. Is this possible?
        • How to change the from address from 'no reply' for an email template in CRM

          Hi, We have our CRM set up with the from field as sales@XXX. I have just created a series of email templates and sent a test and they are sending from noreply@zoho I have tried searching for how to change the email template but don't have the options
        • Zoho CRM Client Script - SetCriteria in lookup Field

          Hello All One More Zoho CRM Client Script Tips & Trick. Now you can Set the Criteria on Your lookup in zoho CRM, It Comes With a Create Page, Edit Page, and Details Page (Standard). Example:- We have a Room Module that includes Room Name, Status, Campus,
        • Kaizen #71 - Client Script ZDKs for Detail (Canvas) Page

          Hello everyone! Welcome back to another interesting Kaizen post. In this post, we can discuss Client Script ZDKs support for Detail (Canvas) Page. What is Detail (Canvas) Page? A Detail(Canvas) Page allows you to customize the record detail page to your
        • how to use validation rules in subform

          Is it possible to use validation rules for subforms? I tried the following code: entityMap = crmAPIRequest.toMap().get("record"); sum = 0; direct_billing = entityMap.get("direct_billing_details"); response = Map(); for each i in direct_billing { if(i.get("type")
        • Add Custom Reports To Dashboard or Home Tab

          Hi there, I think it would be great to be able to add our custom reports to the Home Tab or Dashboards. Thanks! Chad
        • Rich-text fields in Zoho CRM

          Hello everyone, We're thrilled to announce an important enhancement that will significantly enhance the readability and formatting capabilities of your information: rich text options for multi-line fields. With this update, you can now enjoy a more versatile
        • Zoho Reports Duplicating Entries

          I have a custom costing tab with a table where we entre invoices. These are under a Heading (PO Subject) and notes added in the form with different line items. In the reports, I have organised the report to group per PO Subject, with the total of the
        • Validation Rule Not Working for Mandatory Field in Zoho Blueprint

          As a Zoho user, we created a validation rule for a specific field. However, we noticed that when we made the same field mandatory within a Blueprint, the validation rule we defined did not work. When we reported this issue to Zoho Support, they stated
        • Notes Issues

          Been having issues with Notes in the CRM. Yesterday it wasn't showing the notes, but it got resolved after a few minutes., Now I have been having a hard time saving notes the whole day. Notes can't be saved by the save button. it's grayed out or not grayed
        • Export from Contacts module to Products module in Zoho CRM

          Good afternoon, I would like to send a number of contact info from the Contacts module into the customized module (tickets to an event) in one operation. I have selected several contacts in the Contact module (people who I have labelled as people I want
        • Zoho Commerce

          Hi, I have zoho one and use Zoho Books. I am very interested in Zoho Commerce , especially with how all is integrated but have a question. I do not want my store to show prices for customers that are not log in. Is there a way to hide the prices if not
        • Can’t receive emailI c

          I have generated a basic for but when I submit it I don’t get a email, I’ve been in the settings and tested me email, all appears correct, can you please help me
        • Data Capture for Historical Activity (Especially One Lead Downloading Variois reports without Overwriting the info)

          Is there a better way in Zoho CRM to capture and archive a lead’s historical activity—specifically whenever they download reports—so that the data is stored without being overwritten?”
        • Client Script - Updating Field Value in Detail Page of a Lead

          Hello, I'm trying to use Client Script To enrich some data of the Lead when one of my User fill the "City" field in the detail page of the Lead. This is my Script: log (value); var response = ZDK.Apps.CRM.Functions.execute("getInfoCitta", { "nomeCitta":
        • Auto shapes in Zoho sheet.

          Does Zoho sheet supports inserting auto shapes (rectangle, circle...). I did not see any option to do so.  If its not supported currently, is there any plans on bring in this features. Any timelines ?
        • I Can't Clone Webinar that I Co-Organize

          How do i get our account admin to give me permission to clone our webinars? I am a co-organizer
        • I want to Make the due date of the project appears automatically

          hello everyone I want to know if the zoho projects app can add automatically the END DATE of the project I added the duration, start after dates of each tasks in the project template & the starting date of the project itself and the end date of it doesn't
        • Introducing Profile Summary: Faster Candidate Insights with Zia

          We’re excited to launch Profile Summary, a powerful new feature in Zoho Recruit that transforms how you review candidate profiles. What used to take minutes of resume scanning can now be assessed in seconds—thanks to Zia. A Quick Example Say you’re hiring
        • How to get the call recording external ID via desk API

          I have enabled phonbridge integration with Zoom Call. I am trying to access the call recording in Zoom by calling Zoom API. I have built a Desk workflow to trigger on a new call, to call a custom function. when calling the API, the response doesn't contain
        • Can't View Project Names in Mobile App

          I can't view project names on PO's in the app, nor can I add that as a viewable PDF field in inventory on the computer. I've attached screenshots showing that in the mobile version whether you are on the PO, editing the PO, or viewing the PO line items,
        • How do you print a refund check to customer?

          Maybe this is a dumb question, but how does anyone print a refund check to a customer? We cant find anywhere to either just print a check and pick a customer, or where to do so from a credit note.
        • Notebook

          I have purchased the monthly pro subscription of Notebook. But it does not support my XP-Pen to write something in it. So it is not useful to me. Hence I am requesting you to help me to discontinue this subscription.
        • Domain Mapping & Image Publishing Issues on Zoho Sites

          Hello, I am facing two issues with my Zoho Sites account: 1. Images not visible after publishing. 2. Domain mapping error: "Domain already exists". I am a paid customer. Please connect me with Live Chat Support or Zoho Assist so I can show my issue
        • Prevent duplicate with custom fields?

          I was wondering something about custom field/custom modules in Zoho Desk. For some reason you can make a custom field mandatory but not unique? For example, if I create a custom module to manage equipment and renewal and make a field serial number no
        • Round robin

          Hi, I'm trying to set up a round robin to automatically distribute tickets between agents in my team but only those tickets that are not otherwise distributed by other workflows or direct assignments. Is that possible and if so which criteria should I
        • "Is Zoho CRM customer" vs "Is linked with Zoho CRM"

          Recently while building a Flow, I was setting up a Decision action following a Zoho Invoice Fetch record action. There were 2 choices that I had not seen as something I could manually action in Zoho Invoice: "Is Zoho CRM customer" and "Is linked with
        • Two currencies

          More and more I am finding that internattional payments' fees are unpredictable. I would like, on my invoices that are in a foreign currency (eg. USD$ or EUR€) for there to be a GBP£ TOTAL display alongside the invoice's currency total. This would make
        • Automatic Matching from Bank Statements / Feeds

          Is it possible to have transactions from a feed or bank statement automatically match when certain criteria are met? My use case, which is pretty broadly applicable, is e-commerce transactions for merchant services accounts (clearing accounts). In these
        • Generate leads from instagram

          hello i have question. If connect instagram using zoho social, it is possible to get lead from instagram? example if someone send me direct message or comment on my post and then they generate to lead
        • Zoho PDF editor has a lot of issues.

          Zoho PDF editor needs a lot of work. It hangs and glitches a lot. Deletes annotations and clearings randomly.
        • Where is the desktop app for Zoho Projects???

          As a project manager, I need a desktop app for the projects I manage. Yes, there's the web app, which is AWESOME for cross browser and platform compatibility... but I need a real desktop app for Projects that allow me to enter offline information where
        • How to Automate Monthly PDF Reports with Filters in Zoho Creator

          Hi everyone, I’m trying to build an automated monthly reporting process in Zoho Creator and would appreciate suggestions or best practices from anyone who has done something similar. What I’m trying to do: I have a form called New_Customer with fields
        • Feedback: Streamlining Note Management in Zoho Notebook

          Dear Team/Support, I would like to share some feedback regarding the note management system that could help improve usability and accessibility for users like myself. Notebook 1 (screenshot attached): Currently, the system does not allow selecting and
        • showing Limit exceeded

          Good afternoon...trust you're good. I've been having issues working with but it's not responding. it's showing Limit exceeded, sorry it seems like too many people are working on the sheet right now please try again later. meanwhile no one is working on
        • Converting Sales Order to Invoice via API; Problem with decimal places tax

          We are having problems converting a Sales Order to an Invoice via API Call. The cause of the issue is, that the Tax value in a Sales Order is sometimes calculated with up to 16 decimal places (e.g. 0.8730000000000001). The max decimal places allowed in
        • Sorting columns in Zoho Projects

          Hi, In project management best practice, sorting columns (ascending, descending) is an important tool. Sorting dates to see the order of tasks starting, sorting on priority or even on planned hours is a must for an efficient project control. Currently,
        • Next Page