Power of Automation::Automate the process of re-opening the Milestone once Task is re-opened.

Power of Automation::Automate the process of re-opening the Milestone once Task is re-opened.

Hello Everyone,

Here we are again with another requirement that was fulfilled utilizing the Task custom functions.

In general, a custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it.

So, many of us would have explored the Gallery custom function - Milestone Autocomplete that will automatically update the status of the Milestone as completed once all the Tasks and Issues associated to the Milestone is closed.

Similarly, here is a custom function code which would update the Milestone status as Reopen when any of the Tasks status that is associated to the Milestone is updated to Reopen

Custom function code:

endPointV3 = "https://projects.zoho.com/api/v3/portal/";
milestoneStatusIds = List();
milestoneStatusNames = List();
milestoneParameter = Map();

// Get milestone layout details

milestoneLayoutDetails = invokeurl
[
url :endPointV3 + portalId + "/projects/" + projectId + "/milestones/layouts"
type :GET
connection:"xxxxxxxxxx"
];
milestoneCustomFieldDetails = milestoneLayoutDetails.get("section_details").get(0).get("customfield_details");
for each  milestoneCustomFieldDetail in milestoneCustomFieldDetails
{

if(milestoneCustomFieldDetail.get("api_name").equalsIgnoreCase("status"))
{
milestoneStatusIds = milestoneCustomFieldDetail.getJSON("picklist_details");
milestoneStatusNames = milestoneCustomFieldDetail.getJSON("picklist_valuemap");
}
}

// Milestone re-open status id

indexOfReopen = milestoneStatusNames.indexOf("Reopen");

// Get milestone details

milestoneResponse = zoho.projects.getRecordById(portalId,projectId,"milestones",milestoneId,"xxxxxxxxxx");
if(milestoneResponse.containKey("milestones"))
{
milestoneStatusId = milestoneResponse.get("milestones").get(0).get("status_det").get("id");
}
else
{
return "Couldn't update status of none milestone";
}
if(milestoneStatusId != milestoneStatusIds.get(indexOfReopen))
{
milestoneParameter = Map();
milestoneParameter.put("milestone_ids",{"" + milestoneId + ""});
milestoneParameter.put("update_fields",{"CUSTOM_STATUSID":"" + milestoneStatusIds.get(indexOfReopen) + ""});
updateMilestoneDetails = invokeurl
[
url :endPointV3 + portalId + "/projects/" + projectId + "/milestones/" + milestoneId + "/updatefieldvalue"
type :POST
parameters:toString(milestoneParameter)
connection:"xxxxxxxxxx"
];
}
return "success";

Make sure to replace xxxxxxxxxx in the above code with the connection name. Screenshot of the list of parameters to be mapped is attached for reference.


By utilising the custom function provided above, we have embraced automation as an alternative to manually adjusting the Milestone's status to "Re-open."

We hope you found this post useful. If you have any questions or wondering if your requirement could be met using custom functions, feel free to share them in the comments section below. 

    Access your files securely from anywhere







                        Zoho Developer Community






                                              • Desk Community Learning Series


                                              • Digest


                                              • Functions


                                              • Meetups


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner


                                              • Word of the Day


                                              • Ask the Experts



                                                        • Sticky Posts

                                                        • 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
                                                        • 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,
                                                        • 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:


                                                        Manage your brands on social media



                                                              Zoho TeamInbox Resources



                                                                  Zoho CRM Plus Resources

                                                                    Zoho Books Resources


                                                                      Zoho Subscriptions Resources

                                                                        Zoho Projects Resources


                                                                          Zoho Sprints Resources


                                                                            Qntrl Resources


                                                                              Zoho Creator Resources



                                                                                  Zoho CRM Resources

                                                                                  • CRM Community Learning Series

                                                                                    CRM Community Learning Series


                                                                                  • Kaizen

                                                                                    Kaizen

                                                                                  • Functions

                                                                                    Functions

                                                                                  • Meetups

                                                                                    Meetups

                                                                                  • Kbase

                                                                                    Kbase

                                                                                  • Resources

                                                                                    Resources

                                                                                  • Digest

                                                                                    Digest

                                                                                  • CRM Marketplace

                                                                                    CRM Marketplace

                                                                                  • MVP Corner

                                                                                    MVP Corner







                                                                                      Design. Discuss. Deliver.

                                                                                      Create visually engaging stories with Zoho Show.

                                                                                      Get Started Now


                                                                                        Zoho Show Resources


                                                                                          Zoho Writer Writer

                                                                                          Get Started. Write Away!

                                                                                          Writer is a powerful online word processor, designed for collaborative work.

                                                                                            Zoho CRM コンテンツ





                                                                                              Nederlandse Hulpbronnen


                                                                                                  ご検討中の方




                                                                                                        • Recent Topics

                                                                                                        • How to reduce programmatically the image uploaded by user?

                                                                                                          I need a function that will automatically reduce the pixel dimension to 800 x 600 pixels / 180 resolution or (approx. 1.37MB) of image uploaded by user from digital camera, for example, 2271 x 1704 pixels /180 resolution or approx. 11.1MB. After the user selected the image, the function will able to detect if pixels is above 800x600, process the photo (crop/ reduce) and resume upload. Need help...  
                                                                                                        • Dark mode for Zoho Creator / Zoho CRM Code editor

                                                                                                          Hi Team, Is there any plans for Dark mode in Zoho creator / Zoho Crm code editor and development pages in pipeline?
                                                                                                        • Is there a way to make a button scroll down?

                                                                                                          Looking to have a button on a landing page scroll down to another section on the page. Any recomendations outside of coding?
                                                                                                        • Collective-booking event not added to all staff calendars

                                                                                                          We assign two staff to certain events. When the client books this event, it adds it to one staff calendar (the 'organiser') but not the other. How can I ensure all staff assigned to a collective booking get the event in their calendar? (A side note: it
                                                                                                        • ZOHO Android Client

                                                                                                          Hi, I installed the Android app, but it had an issue, so I reinstalled it. I was able to add multiple accounts, but now when I add the next account, it just duplicates the one I already have and will not even allow me to enter the info for another account.
                                                                                                        • I'd like to suggest a feature enhancement for SalesIQ that would greatly improve the user experience across different channels.

                                                                                                          Hello Zoho Team, Current Limitation: When I enable the pre-chat form under Brands > Flow Controls to collect the visitor’s name and email, it gets applied globally across all channels, including WhatsApp, Messenger, and Instagram. This doesn't quite align
                                                                                                        • Enhance Barcode/QR Code scanner with bulk scanning or continuously scanning

                                                                                                          Dear Zoho Creator, As we all know, after each scan, the scanning frame closes. Imagine having 100 items; we would need to tap 100 times and wait roughly 1 second each time for the scanning frame to reopen on mobile web. It's not just about wasting time;
                                                                                                        • Managing Rental Sales in Zoho Inventory

                                                                                                          I am aware that Zoho Inventory is not yet set up to handle rental sales and invoicing. Is anyone using it for rentals anyway? I'd like to hear about how others have found work arounds to manage inventory of rental equipment, rental payments, etc. Th
                                                                                                        • Megamenu

                                                                                                          Finally! Megamenu's are now available in Zoho-Sites, after waiting for it and requesting it for years! BUT ... why am I asked to upgrade in order to use a megamenu? First: Zoho promised to always provide premium versions and options for all included Zoho-applications
                                                                                                        • Zoho Flow to Creator 3001 Respoonse

                                                                                                          I have updated my Flows with the new V2 connection to Zoho Creator, but now some Flows do not work. They take in data from a Webhook and are supposed to create a record in Creator, however creator returns a 3001 message along with a failure, but I cannot
                                                                                                        • File Upload to Work Drive While Adding Records in Zoho Creator Application

                                                                                                          Hi I am trying to set a file attachment field in zoho creator form, to enable the user to upload a scanned document from their local pc. The file should be uploaded to zoho workdrive and not to the default zoho creator storage. The file link should be
                                                                                                        • Why not possible to generate?

                                                                                                          Using this https://desk.zoho.com/DeskAPIDocument#TicketCount#TicketCount_Getticketcountbyfield on my ZML script url :"https://desk.zoho.com/api/v1/ticketsCountByFieldValues?departmentId=XXXXXXXXXXX&accountId!=XXXXXXXXX&customField1=cf_country_1:XXXXXX&field=overDue"
                                                                                                        • email

                                                                                                          Hi My crm email is not working, can you check, I have zoho one account.
                                                                                                        • Need option to see Mass Emails & Cadences in Gmail Outbox OR a dedicated Zoho Outbox

                                                                                                          Hi everyone, Right now, when we send 1:1 emails from gmail (with gmail API connected to Zoho CRM), those emails appear both in gmail's sent folder and in Zoho CRM. That works well. But when we send Mass Emails or Cadence emails form Zoho CRM, they are
                                                                                                        • I can't found API for Sales Receipts

                                                                                                          Hello May you please help me to find an API document for Sales Receipts to get data and retrive a custom fields like Invoice and credit notes Regards
                                                                                                        • Kaizen #205 - Answering Your Questions | Managing Picklists and Enabling History Tracking via Zoho CRM APIs

                                                                                                          Hello everyone! Welcome back to another post in our Kaizen series. In this post, we will look at how you can manage picklist fields in Zoho CRM using APIs. This topic was raised as feedback to Kaizen #200, so we are taking it up here with more details.
                                                                                                        • Multiple Vendor SKUs

                                                                                                          One of the big concerns we have with ZOHO Inventory is lack of Vendor Skus like many other inventory software packages offer. Being able to have multiple vendor skus for the same product would be HUGE! It would populate the appropriate vendor Sku for
                                                                                                        • Internally created tickets

                                                                                                          Hi there When tickets are created internally on-behalf of customers - there is nothing to show that the ticket was created by an internal agent. This means, that it's easy for our agents to confuse tickets which were created by internal team members and
                                                                                                        • Automatically change website passwords

                                                                                                          Hi everyone, We just switched to a Professional package to also use the "Automatically change website passwords" function. But I cannot find anything about it, how to use it, anywhere. Does anyone know how I can use this function? Best, Caspar
                                                                                                        • Change Invoice Prices for an Effective Date

                                                                                                          Hi, It would be a really good feature to be able to change the prices on invoices/recurring invoices from an effective date in the event of price increases. For instance, I am in the process of increasing prices that will be effective from a specific
                                                                                                        • "Other Current Asset" accounts as "Paid Through" accounts in Expense

                                                                                                          It would be incredibly useful to be able to assign accounts of type Other Current Asset as Paid Through accounts in Expense. Currently, Other Current Liability are permitted as Paid Through Accounts. This makes sense, as Credit Cards are current liabilities.
                                                                                                        • Multi column open text questions that allows respondents to add rows for additional information

                                                                                                          I need to create a question that has 2 columns with open text, but I also need to allow respondents to click a "+" button, or something similar, so that they can add additional information if they choose to. I've tried using the Multiple Textboxes type
                                                                                                        • Bot Filtering & Apple Mail Privacy Protection Compliance in Zoho Campaigns

                                                                                                          Dear Campaigns Users, The wait is over! We’re excited to announce that the enhanced bot filtering feature is now live in Zoho Campaigns. This update brings greater accuracy to your email campaign reports by distinguishing real user engagement from automated
                                                                                                        • Découvrons les détails qui simplifient vos journées de travail avec Trident

                                                                                                          Nous nous installons dans des routines efficaces et rodées avec le temps. Chaque matin, nous ouvrons nos e-mails, passons aux messages, consultons notre agenda, puis attaquons nos tâches. Ce processus nous semble maîtrisé, mais est-il réellement optimisé
                                                                                                        • Issue with Purchase Rate Showing as “0” After Importing Items List

                                                                                                          Dear Zoho Books Support Team, Good day. I’m reaching out regarding an issue I’m facing while importing my items list into Zoho Books. Despite mapping all fields correctly and including the purchase price for each product in my Excel file, the Purchase
                                                                                                        • API for Task Entity in Zoho Books

                                                                                                          I’m working on automating task creation in Zoho Books via a custom button in the Bills Module. The goal is to create a task in the Tasks Module and assign it to the Finance Team, so they can track progress efficiently. While reviewing Zoho Books documentation,
                                                                                                        • create invoice in zoho books from the zoho forms

                                                                                                          Is there a native way to have create invoice in zoho books, when zoho form is completed?
                                                                                                        • Email undelivered

                                                                                                          GOod Day I am always receiving an uncategorized-bounce to my email. I am not sure why this is happening.
                                                                                                        • Add inventory_valuation_method to items endpooints

                                                                                                          To ensure consistent item creation it would be helpful to have the inventory_valuation_method (FIFO vs WAC) be able to be set at item creation or as an update (consistent with current behavior where it is not allowed for items with existing transactions)
                                                                                                        • Use Zoho to send sales receipts for Gocardless transactions

                                                                                                          I've been using gocardless for years and have d/d mandates set up on there. Each week we get bulk payments from customer d/d's. However, we need to send sales receipts to these customers. So I know I can sync mandates into Zoho, and then I can set up
                                                                                                        • Zoho - Gocardless sales receipts

                                                                                                          I've been using gocardless for years and have d/d mandates set up on there. Each week we get bulk payments from customer d/d's. However, we need to send sales receipts to these customers. So I know I can sync mandates into Zoho, and then I can set up
                                                                                                        • Introducing Rollup summary in Zoho CRM

                                                                                                          ------------------------------------------Moderated on 5th July'23---------------------------------------------- Rollup summary is now available for all organizations in all the DCs. Hello All, We hope you're well! We're here with an exciting update that
                                                                                                        • Introducing Connected Workflows in Zoho CRM for Everyone : Free Your Teams to Focus on What Matters

                                                                                                          Hello Everyone, We’re thrilled to introduce the next big evolution in Zoho CRM for Everyone -- Connected Workflows. This new feature builds on our commitment to deliver a CRM that’s truly inclusive, adaptable, and designed for consistent collaboration
                                                                                                        • Cooling-off Period Just Got Better: More Coverage, More Control

                                                                                                          We’ve enhanced the Cooling-off Period feature in Zoho Recruit to give you more control over repeat applications and referrals. This helps you maintain a cleaner, more efficient recruitment pipeline. With this enhancement, you can: Prevent duplicate candidate
                                                                                                        • Revenue Management: #7 Revenue Recognition in Construction & Real Estate Industry

                                                                                                          If you are in the construction or real estate business, you are used to long project timelines and progressive invoicing to keep up with your billing. But when does revenue get recognized? Will it happen when the contract gets signed? At different milestones
                                                                                                        • TikTok (and other social platform) Messages and comments of the past

                                                                                                          When I link a social channel, Zoho will show in "Inbox", "Messages" and "Contact" sections the interaction done in the past? (comment, messages...)
                                                                                                        • Restrict Employee mail deletion

                                                                                                          Dear Zoho, Is there a way where i can restrict my employees to delete any mails from their account
                                                                                                        • 554 5.1.8 Email Outgoing Blocked.

                                                                                                          Hi guys, I just singed up for mateusz.nowicki@zoho.com mail and I can't send any mails.. Why? Everytime I try to send something I got error like the one in the screenshot. Please, help me.
                                                                                                        • Zoho IP blocked by SpamHaus

                                                                                                          ERROR CODE :550 - 5.7.0 Your server IP address is in the SpamHaus SBL-XBL database, bye
                                                                                                        • File Upload in Creator's Subfrom

                                                                                                          Hello Sir/Madam, Here is a Problem......... Scenario: In CRM One Custom Module (Payments) have one File Upload Field now we have to Upload that File into Creator's Custom Form (Documents) have one Subform (Documents) in Document Upload Field using Deluge
                                                                                                        • Next Page