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
milestoneCustomFieldDetails = milestoneLayoutDetails.get("section_details").get(0).get("customfield_details");
for each  milestoneCustomFieldDetail in milestoneCustomFieldDetails

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");
milestoneStatusId = milestoneResponse.get("milestones").get(0).get("status_det").get("id");
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
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. 

                        Zoho Marketing Automation

                                • Sticky Posts

                                • Introducing Projects 8.0 - Focusing on Ease-of-Use and New Features

                                  Hello everyone! It's time for the reveal of the 8th version of Zoho Projects! This year our focus has been on minimizing the learning curve and improving the ease-of-use of the tool, so anyone new to Projects can hit the ground running and existing users
                                • Gallery Function for Updating Project Status

                                  A custom function is a software code that can be used to automate a process.  Gallery functions are a set of pre-defined custom functions in Zoho Projects. Users can automate these functions by establishing a Connection and by associating it with a Workflow.
                                • Tip 37: Time Log Restriction in Zoho Projects

                                  Timesheet in Zoho Projects helps you big time in entering log hours for the tasks and issues and approving them. Now, with the new Time Log Restriction option, you can set daily and weekly log hour limits. You can restrict users from entering extra log hours than the permissible limit. The limits are restricted to 24 hours per day and 168 hours per week by default based on business hours. To customize, navigate to Task & Timesheet settings under Portal Configuration in Zoho Projects setup and enable
                                • Work agile in Zoho Projects! The much-awaited Zoho Sprints integration is in the making.

                                  Let your teams work in both classic and agile methodology using our integration with Zoho Sprints. We made sure you get the best of both worlds with this integration. You can scale through teams irrespective of what methodology they use and make sure they work with speed and flexibility. And, you can do it all from one place- Zoho Projects.  Why this integration is a benefit?  This integration mostly helps in managing classic and agile practices together. Most organizations use a mix of both classic
                                • Tip#28: Project Timeline Gantt in Zoho Projects

                                  Hi Folks! As part of the tips and tricks series, we are back with a tip on Project Timeline Gantt.  Here’s how you can use Project Timeline Gantt   1. Prioritize your projects based on percentage completed and focus on the projects that are currently in your pipeline.  Hover over the project name to know percentage completed.  2. Visualize your projects on the Gantt plotted for 3 consecutive years - previous year, current year and next year. You can adjust the timeline view from fit to max.  3. Navigate

                                Manage your brands on social media

                                        Zoho TeamInbox Resources

                                          Zoho DataPrep Resources

                                            Zoho CRM Plus Resources

                                              Zoho Books Resources

                                                Zoho Subscriptions Resources

                                                  Zoho Desk Resources

                                                    Zoho Projects Resources

                                                      Zoho Sprints Resources

                                                        Qntrl Resources

                                                          Zoho Creator Resources

                                                            Zoho WorkDrive Resources

                                                              Zoho Campaigns Resources

                                                                Zoho CRM Resources

                                                                • CRM Community Learning Series

                                                                  CRM Community Learning Series

                                                                • Tips


                                                                • Functions


                                                                • Meetups


                                                                • Kbase


                                                                • Resources


                                                                • Digest


                                                                • CRM Marketplace

                                                                  CRM Marketplace

                                                                • MVP Corner

                                                                  MVP Corner

                                                                • Word of the Day

                                                                  Word of the Day

                                                                        Design. Discuss. Deliver.

                                                                        Create visually engaging stories with Zoho Show.

                                                                        Get Started Now