Power of Automation :: Automatically close the associated tasks once the Issues are closed

Power of Automation :: Automatically close the associated tasks once the Issues are closed

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

We have compiled a gallery of the most frequently solved use cases for Issues custom functions. You can access the same using the steps available in this link.        

And, today I would like to highlight one of the Gallery custom functions - Complete associated tasks once all issues are closed
 
Use case:-

This function marks all the associated tasks as completed once all related issues are closed.

Custom function code:-

Create a connection for the Zoho Projects service with the scopes "ZohoProjects.bugs.READ, ZohoProjects.tasks.UPDATE,ZohoProjects.projects.READ". Replace 'xxxxxxxxx' with the connection link name.

Click this link below to learn how to create the connection. Attached a screenshot for Arguments to be used.
projectsDomain = "https://projectsapi.zoho.com";
getAssociatedTasksUrl = projectsDomain + "/api/v3/portal/" + portalId + "/projects/" + bugProjectId + "/bugs/" + bugId + "/associated-tasks";
getAssociatedTasksParam = Map();
getAssociatedTasksParam.put("sindex","0");
getAssociatedTasksResp = invokeurl
[
url :getAssociatedTasksUrl
type :GET
parameters:getAssociatedTasksParam
connection:"xxxxxxxxxx"
];
info getAssociatedTasksResp;
if(getAssociatedTasksResp != null && getAssociatedTasksResp.get("task_array") != null)
{
getTaskLayoutUrl = projectsDomain + "/restapi/portal/" + portalId + "/projects/" + bugProjectId + "/tasklayouts";
taskLayoutDetails = invokeurl
[
url :getTaskLayoutUrl
type :GET
connection:"xxxxxxxxxx"
];
info taskLayoutDetails;
info "-------------------------------------";
statusNamevsIdMap = Map();
if(taskLayoutDetails != null && taskLayoutDetails.get("status_details") != null)
{
statusDetails = taskLayoutDetails.get("status_details");
for each  status in statusDetails
{
statusNamevsIdMap.put(status.get("name"),status.get("id"));
}
}
info "Status NamevsId Map: " + statusNamevsIdMap;
taskArrays = getAssociatedTasksResp.get("task_array");

if(statusNamevsIdMap.get(statusName) != null)
{
for each  taskObj in taskArrays
{
taskId = taskObj.get("TID");
criteriaObj = Map();
criteriaObj.put("cfid","48");
criteriaObj.put("criteria_condition","is");
criteriaObj.put("value",{taskId});
filterCriteria = Map();
filterCriteria.put("criteria",{criteriaObj});
filterCriteria.put("pattern","1");
getTaskAssociatedIssuesParam = Map();
getTaskAssociatedIssuesParam.put("index","0");
getTaskAssociatedIssuesParam.put("range","25");
getTaskAssociatedIssuesParam.put("sort_by","CREATED_TIME");
getTaskAssociatedIssuesParam.put("is_ascending","false");
getTaskAssociatedIssuesParam.put("filter",filterCriteria);
getTaskAssociatedIssuesUrl = projectsDomain + "/restapi/portal/" + portalId + "/projects/" + bugProjectId + "/module/bugs/view/48/";
getTaskAssociatedIssuesRes = invokeurl
[
url :getTaskAssociatedIssuesUrl
type :GET
parameters:getTaskAssociatedIssuesParam
connection:"xxxxxxxxxx"
];
info getTaskAssociatedIssuesRes;
bugEntities = getTaskAssociatedIssuesRes.get("data").get("0").get("entities");
completeTask = true;
for each  bug in bugEntities
{
if(!bug.get("is_completed"))
{
completeTask = false;
break;
}
}
if(completeTask)
{
updateTaskParameter = Map();
updateTaskParameter.put("custom_status",statusNamevsIdMap.get(statusName));
info "updateTaskParameter: " + updateTaskParameter;
taskDetails = zoho.projects.update(portalId,bugProjectId,"Tasks",taskId,updateTaskParameter,"xxxxxxxxxx");
info taskDetails;
}
}
}
}
We hope you found this post useful. If you have any questions, feel free to share them in the comments 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

                                                        • One Place for All Your Automation Needs

                                                          All automation settings are grouped under Settings ()> Automation. This helps you find everything related to automation from one place. Under Workflow Rules, Email Alerts, Email Templates, and Webhooks: Use the Projects tab for project-specific settings.
                                                        • 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,
                                                        • Zoho Projects - Quarterly Updates | Q1 2025

                                                          Hello Users, We would like to share the latest updates for this quarter. Here is a round-up of the features and enhancements we rolled out in Q1: Working with Zoho Projects data in Power BI? Integrate Zoho Projects to Power BI and sync module data (from
                                                        • Analyze Project Trends with Power BI Integration for Zoho Projects

                                                          Integrate Microsoft Power BI with Zoho Projects to sync project data, create reports, and analyze trends. This integration allows you to track key project metrics and share insights with your stakeholders. Managing multiple projects requires clear visibility
                                                        • 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


                                                        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

                                                                                                        • Cant receive emails

                                                                                                          Hi, I just created an account and went through all steps. Everything has been set up from my end, but Ive sent a test mail to the newly created email address, but it never arrived. Can somebody please help me? Thanks!
                                                                                                        • How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.

                                                                                                          How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.
                                                                                                        • Multi-column sorting

                                                                                                          Is multi-column sorting a planned feature for CRM? We are needing to sort by one column and then subsort by another column. I am just wondering if there is a planned feature that will allow this?
                                                                                                        •  【Zoho CRM】サブフォーム内にあとから追加した数式項目を一括して計算させる方法

                                                                                                          皆様のお知恵を拝借いたしたくご相談させてください。 【状況】 任意のタブにすでにサブフォームが設定されており、そのサブフォームを含め、既に数千件のデータが存在している。 【実施したいこと】 新たに数式項目をそのサブフォームに追加して、入力済データのレコードも含めて、その数式項目の計算結果を反映させたい。項目の更新で数式項目をサブフォームに追加しただけでは計算されません。 【わかっていること】 任意のタブのサブフォーム外にあとから数式項目を追加した場合、数式項目を追加しただけでは当然数式項目の計算結果は反映されませんが、以下の方法を実施すると数式項目が計算されます。
                                                                                                        • My Zoho Mail Account Has Been Blocked for Sending Email - Block Type: Mail Outgoing blocked

                                                                                                          Hi everyone... My Zoho Mail account has been blocked for long time... Until now, I cannot sending outgoing email. I was already try to contact Zoho customer support, but there is no reply from them. This is notification which appear on my zoho mail account...
                                                                                                        • Task reminder with custom function

                                                                                                          Hello! I am trying to create a custom function to add a task. With you guys helping, I could create a function but I could not set the reminder. Anyone knows how to add a reminder?  Thank you for your tips!
                                                                                                        • Announcing new features in Trident for macOS (v.1.18.0)

                                                                                                          Hello everyone! Trident for macOS is here with interesting features and enhancements to elevate your workplace communication and productivity. Let's take a quick look at them. Retract sent emails. Whether you've missed adding an important attachment or
                                                                                                        • Zoho Books GST enabling issue.

                                                                                                          Without knowing I have created a Branch in Zoho Books, Now I am trying to enable GST option but is disable? Is there anyway to enable the GST Button?
                                                                                                        • Add a Calender view in Zoho CRM

                                                                                                          I would like to ask if it's possible to add a calendar view to a custom module in Zoho CRM. Is this feature planned for future development? It would be extremely helpful for us. I’d like to allow my users to view the data visually in a calendar layout,
                                                                                                        • Make the edit fields hover in Canvas View look the same as the Detail Page

                                                                                                          The edit field UI in the Canvas View is not consistent with the standard detail page UI. For some modules we have Canvas views, for some we don't. We don't want it to look differently. We want it to look like one system.
                                                                                                        • Validating an order by a superior

                                                                                                          Hi, I have a very specific use case for Backstage. Let me know if this is possible or how I could get around this (or if there are no workaround). One of my client uses Backstage to manage internal (on site) events. Participants from different departments
                                                                                                        • iOS App Version 3.0 - Customer list gone?

                                                                                                          Not sure when this changed, but I seem to have been updated to 3.0 for the phone app (on iOS). I'm pretty sure that I used to have a Customers button that allowed me, for example, to see what appointments a customer has. Has this disappeared or am I just
                                                                                                        • Can't Find or Use Saved Replies in Inbox Module

                                                                                                          I'm an Admin user on Zoho Social, and I've created a few saved replies under Inbox Preferences > Saved Replies. However, when I go to the Inbox module to respond to a message, I don't see any option to insert or use saved replies. I've checked that: I'm
                                                                                                        • Episode II: Begin Your Automation Journey in Zoho Desk with Deluge

                                                                                                          To travel to another country, you need a passport. But that's not enough, you also need a visa, flight tickets, and, most importantly, a mode of transportation. Without these, your journey cannot begin. Similarly, custom functions in Zoho Desk are essential
                                                                                                        • How can I capture the Cliq channel name from Deluge Script?

                                                                                                          I am working on a chat automation with a third party tool called Make.com. Using a webhook I am relaying information from the Bot I have created in Zoho Cliq to Make.com Webhook. I am using the Mention Handler of the bot in Cliq to relay information like
                                                                                                        • Introducing Zoho CRM for Everyone: A reimagined UI, next-gen Ask Zia, timeline view, and more

                                                                                                          Hello Everyone, Your customers may not directly observe your processes or tools, but they can perceive the gaps, missed hand-offs, and frustration that negatively impact their experience. While it is possible to achieve a great customer experience by
                                                                                                        • Backstage Roadmap to Most Requested Features

                                                                                                          Please provide insight as to ETA for the following: 1. Backstage integration with Zoho Showtime, seems like a no-brainer.       1.a. Why does OnAir look eerily like Showtime integration we must 'pay extra for'? 2. Backstage Integration with Zoho Subscriptions
                                                                                                        • How to know number of days between Deal Stages?

                                                                                                          Hi Team - how do I know the number of days between Deal Stages? I have a Deal blueprint and I want to know the number of days it takes the Deal to be on Stage 3 to Stage 8? I can't seem to create a report for that. Our Deals have 11 Stages and our Purchasing department is in charge of Stage 3 to Stage 8 and I want to know the number of days it takes for them to complete their stages?
                                                                                                        • How To Change Open Activities View in Canvas?

                                                                                                          Hi all, I want to have my open activities have this view, but I cannot see how to make it look this way in Canvas. Not only that, but there isn't a way to rearrange the Standard view in Canvas, either. What I want (this is in the Standard layout): What
                                                                                                        • Queries in Custom Related Lists

                                                                                                          Hello everyone, We hope you’re having a great day! A while ago, we introduced Queries in Zoho CRM to help you dynamically fetch data from CRM modules or even external sources—right within your CRM interface. Many of you have already used Queries with
                                                                                                        • Mass emails - Allow preview of which emails will receive the email based on the criteria

                                                                                                          Feature request. Please allow us to view and confirm the exact recipients of the mass emails based on the criteria we've chosen before sending. It can be quite sensitive if you send the mass email to some wrong accounts accidently, so it would be great
                                                                                                        • Customers not receiving emails

                                                                                                          So, a little backstory, we have been using Zoho Forms for the past eight years. And when we initially started, we would have email notifications be sent from inside Zoho Forms after a submission. We recently started using Zoho CRM as we wanted a better
                                                                                                        • Sum Total of various fields in child module and add value to parent module field

                                                                                                          Hi! Having trouble with a custom function, im trying to calculate the total of all the rent and sqm fields of our offices in Products module and have them transfer to the parent module Location. The API names are as below: Child module Products = "Products"
                                                                                                        • Automate your status with Cliq Schedulers

                                                                                                          Imagine enjoying your favorite homemade meal during a peaceful lunch break, when suddenly there's a PING! A notification pops up and ruins your moment of zen. Even worse, you might be in a vital product development sprint, only to be derailed by a "quick
                                                                                                        • Important! ZipRecruiter Sponsored Posting Plan Changes in Zoho Recruit

                                                                                                          Greetings, We’re reaching out to inform you about an important upcoming change to the ZipRecruiter Sponsored job board integration within Zoho Recruit. What’s Changing? Starting June 1, 2025, Zoho Recruit will be updated with ZipRecruiter's latest pricing
                                                                                                        • Generate Unique Customer ID for Each for All Contacts

                                                                                                          Generate Unique Customer ID for Each for All Contacts
                                                                                                        • Mails to Deals

                                                                                                          Hi everybody. We are using ZOHO CRM connected to ZOHO Mail and we have a big trouble, which our ZOHO partner is not able to solve. Zoho CRM automatically connects received emails to last edited live Deal of the same Contact. For us this logic is very
                                                                                                        • ICICI Bank integration

                                                                                                          Why the ICICI bank integration has been disabled? We opened the ICICI bank account only for integraton with Zoho. It is taking lot of time to do manual payments using file upload method. When will be the new ICICI bank integration enabled in India?
                                                                                                        • Google Drive

                                                                                                          How to add more modules in google drive as I don't want Zoho space? TIA
                                                                                                        • Ajust quantities in another form based on subform, on form submission

                                                                                                          Hello, I have an Order form with a LineItems subform. The LineItems subform has many lookups that import data from various other forms. I want to deduct the quantity offered in one of those other form, called Offer. In another application I used the following
                                                                                                        • Workdrive connection in Zoho CRM not working

                                                                                                          Hi, in https://crm.zoho.com.au/crm/orgXXXXXX/settings/connections i have set up the connection for WorkDrive which is pretty much setting up the name and the scopes. But I get "WorkDrive API test response: {"errors":[{"id":"F7003","title":"Invalid OAuth
                                                                                                        • Best Way to Update Subscriber Preferences for an Existing List?

                                                                                                          We currently have a mailing list of over 43,000 contacts in Zoho Campaigns, and we’re looking to segment our list based on subscriber content preferences—things like Free Webinars, Local Training, Store Specials, and New Product Announcements. We’d like
                                                                                                        • Disappearing Mouse cursor in Zoho Mail / Windows 11 (Chrome + Edge)

                                                                                                          I'm seeing an issue when writing mails with the light theme with the mouse cursor being white and the document area also being white - making it nearly impossible to see the mouse cursor. I see the problem on Windows 11 under Chrome and Edge. (Yet to
                                                                                                        • What's New in Zoho Inventory | January - March 2025

                                                                                                          Hello users, We are back with exciting new enhancements in Zoho Inventory to make managing your inventory smoother than ever! Check out the latest features for the first quarter of 2025. Watch out for this space for even more updates. Email Insights for
                                                                                                        • Equivalent domains

                                                                                                          Need a settings feature for adding/modifying/deleting domains that use the same login service. The feature can also suggest some popular sites that use shared credentials to access domains under their control. For example: amazon.com and its local variations like amazon.in. For example: gmail.com and google.com. LastPass has this feature.
                                                                                                        • Learning how to customize templates via code and best practices

                                                                                                          Hi! Our developers team want to learn how to edit our template files safely. The last time we messed with these files our site went down for a day and we had to reconfigure it from scratch. What are the best practices to do this? How can we get a template
                                                                                                        • Inquiry: Integrating In-house Chatbot with Zoho Desk for Live Agent Support

                                                                                                          Hi Team, We are exploring the possibility of integrating our existing in-house chatbot with Zoho Desk to provide seamless escalation to live agents. Our requirement is as follows: within our chatbot interface, we want to offer users a "Talk to Agent"
                                                                                                        • I need to know the IP address of ZOHO CRM.

                                                                                                          The link below is the IP address for Analytics, do you have CRM's? https://help.zoho.com/portal/ja/kb/analytics/users-guide/import-connect-to-database/cloud-database/articles/zoho-analytics%E3%81%AEip%E3%82%A2%E3%83%89%E3%83%AC%E3%82%B9 I would like to
                                                                                                        • You are forced to store/manage custom functions redundantly | Any solutions?

                                                                                                          Hello there, you are forced to store code (custom functions) redundantly if you want to use the same functionality in multiple departments. I don't understand that you can't define global functions. When I make a change to a function I may have to do
                                                                                                        • Integrating Zoho CRM with Quickbooks Enterprise?

                                                                                                          Does anyone have any experience of integrating Zoho CRM with Quickbooks Enterprise?  The Zoho pages refer to the Quickbooks Premier edition, and I wanted to know if the same works with the Quickbooks Enterprise version.
                                                                                                        • Next Page