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.

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      • Sticky Posts

      • Zoho Projects Roadshow, USA - 2024

        Dear Users, We are happy to announce the Zoho Projects Roadshows 2024 in USA. This is an excellent opportunity to learn more about Zoho Projects and gain in-depth knowledge of the advanced features. Our team will also discuss industry specific solutions
      • Project Billing with the Staff Hours Method in Zoho Projects

        The Staff Hours Billing Method in Zoho Projects allows you to bill your clients based on the actual time spent by each team member on a project, at the rate set for each user. This is useful for projects where different skill sets are needed and service
      • 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
      • Organize and Track Phases with Phase Custom Views

        Phase Custom Views let you filter and display phases based on specific criteria. This helps you focus on what’s most relevant for you and your team. Filter phases using criteria such as budget, status, and more. Share views with specific users or teams
      • Create Your Own Issue Management System

        Effective issue management is a cornerstone of project success. Every bug or issue, no matter how small, needs to be tracked and resolved in time to maintain project momentum. In this post, we’ll explore how an issue management system in Zoho Projects

      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

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

                            Zoho CRM コンテンツ






                              ご検討中の方

                                • Recent Topics

                                • Contemplating moving my site from WordPress to Zoho Sites

                                  Hi Everyone, We currently find ourselves in a situation where we ant to review and update our current sites content. We are small business owners, not developers. We currently use a wide range of Zoho products. We sometimes think about the possibility of either moving or just starting from scratch on Zoho Sites. I would like to know if anyone has done this and of course the things that need to be considered. We have spent quite a bit of time getting our current site positioned organically and I guess
                                • Change email template depending on answer from form

                                  Is it possible to set up the following in Zoho Desk: When a user submits a ticket via the Zoho Help Center's form, they can select an answer from a dropdown field. In this example, the dropdown options are 'Option A' and 'Option B.' If a user selects
                                • How to view all departments on one dashboard or ticket view?

                                  Hi guys, We've just started using Zoho Support and found a very weird quirk. It seems that you need to click into each deparment to view the new tickets instead of just seeing a global dashboard of all tickets across all departments. Seems very odd, is this correct or are we missing something? If this is currently not possible, can someone from Zoho let us know if a global dashboard view is going to be developed soon? How soon? This is going to be a dealbreaker for us as we have lots of departments...
                                • Is Drawing feature supported in zoho Sheets?

                                  Is there any option to draw arrows and some basic shapes such as circle , rectangle etc in zoho sheets? if so, can someone help me find it 
                                • Conexion CREATOR x CRM

                                  Buenas tardes, Tengo un problema con un código que crea un registro en CRM. Revisé el CRM para eliminar los campos obligatorios, pero cuando ejecuto el programa, aparece el siguiente mensaje de error: {"code":"MANDATORY_NOT_FOUND","details":{"api_name":"data"},"message":"required
                                • Is there a way to sync Tags between CRM and Campaigns/Marketing Hub?

                                  I wonder if there is a way to synch the tags between CRM and Marketing-Hub / Campaigns?
                                • IP Addresses for Whitelist

                                  Hi,  Where can I get a list of the IP addresses I need to whitelist for accessing Zoho Desk? TIA
                                • We would like to make a separate, internal-only knowledge base. Is it possible to have a public department but not display it in the help center?

                                  It seems like it is not possible to display/hide the knowledge base from the help center per department.  Is there a way to do this? It looks like all department knowledge bases are displayed if they are public, and there is no way to hide one from the help center while keeping it accessible via a permalink URL. For example, lets say I have one KB for Clients and one for Employees.    I want to keep my Clients KB public, and also want the Employees KB to be public, but NOT displayed in the help center.
                                • Template Email Reset Password

                                  Hi It is possible to customize the email that comes to a Customer Portal user? It comes in English and need this in Spanish. Esteban Elias Preventa Tecnica - Educacion Xpears.com
                                • URL_ROLLING_THROTTLES_LIMIT_EXCEEDED

                                  Hello, for several times now we are getting URL_ROLLING_THROTTLES_LIMIT_EXCEEDED in the Failure tab. What does it mean, and how can we solve this? Thanks, M.
                                • Possible to customise list of file attachment options?

                                  Is it possible to customise (disable/remove) the list of file attachment options (see screenshot below)? I would like the users to only use the options "Link (URL)" and "Other Cloud Drives". I have super admin rights to customise the CRM.
                                • Automating CRM backup storage?

                                  Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
                                • Ayuda con zoho creator x zoho Crm

                                  Hola a todos, Estoy teniendo dificultades al sincronizar datos entre Zoho Creator y Zoho CRM. Mi objetivo es lo siguiente: Busque un registro en el módulo Contactsde Zoho CRM utilizando el correo electrónico del registro de Zoho Creator. Si se encuentra
                                • Invoices with billable time and expenses

                                  I cannot seem to get a straight answer. We are looking to create an invoice to send to our clients, but it needs to have the following on it: 1. Billable hours for each employee. All hours for the pay period on one line, by employee. 2. Expenses for each
                                • URL for downloading uploaded file - THE SOLUTION

                                  Hi, I would like to share the solution for downloading uploaded files using url. There is no documentation for it and there are multiple forum threads with old solutions that didn't work for me. Here is the updated url - tested and works! fet = form_name[ID
                                • All Tasks Queued for Last 3+ Hours

                                  How does one resolve this? All of my tasks, from many different Flows, are stuck in the "Queued" status. This is interrupting my business processes, which depend on the timely execution of automations.
                                • Why can't I connect to the software suddenly? Network error, internal error, unable to contact you

                                  Why can't I connect to the software suddenly? Network error, internal error, unable to contact you
                                • Auto Generated Invoice number YEAR

                                  Auto Generated Invoice number shows transaction year as 25 even though it's 24 still.
                                • The Social Wall: December 2024

                                  Hey everyone, As the year comes to an end, and the festive spirit fills the air, we're thrilled to bring to you the final edition of the Social Wall for 2024. Let's see what updates went live during December, and then go on with planning the new year!
                                • Not displaying a newly created window within an application

                                  On a specific stock trading application (see image below), when a newly created full screen operation is invoked (File->New) oft times it is invisible (the mouse input is correctly routed to the new window but the hover over contents shows the invisible
                                • Last payroll of the year gives me an error

                                  Trying to run the last payroll of the year. The payment doesn't get to the employee until 1/1/25, which is correct. However when I try to process it I get the following error: Tax calculation is not supported for the year 2025. Please change the Pay date.
                                • Global Outage - Please Update Current Status

                                  It looks like Zoho Mail services are down everywhere. Please update with current status and time-to-resolution.
                                • Is the filename of an attachment restricted to only certain languages?

                                  Hi, I tried to create a file card in a notebook, but I encountered an issue: when the filename of an attachment is in languages other than the main ones (such as English, Japanese, or Simplified Chinese......), syncing stops or the filenames become garbled
                                • Sync workspace - table

                                  I have connected two workspaces and I have imported two different query tables from one workspace to the other one, that was a succes. But now I want to import another query table from the same workspace to the other but I get an error. Why is that? (there
                                • Odd Authorization warnings

                                  I'm a superadmin for Zoho One and double-checed that I was an Admin role in Teams. Every once in awhile, I'll get a strange notification that I can't do something (usually deleting something although I am under the 250 thread limit). Is there somewhere
                                • Zoho und die Art, Dinge zu tun

                                  Zoho und die Art, Dinge zu tun Ich habe Zoho seit über zehn Jahren in verschiedenen Projekten implementiert – einige groß, andere sehr groß – und habe sogar für einen der weltweit führenden Zoho-Partner gearbeitet. Jedes Mal, wenn ich ein Zoho-Implementierungsprojekt
                                • Free webinar: Zoho Sign 2024 wrap-up - Everything that is new and has changed

                                  Hello, Are you looking up to catch up on all the updates made to Zoho Sign in 2024? Or are you still figuring out how you can use Zoho Sign better to get business paperwork done more efficiently? If so, we invite you to join us this Thursday, December
                                • View of all Leads (+converted)

                                  Hi, Is there a View of all Leads this month includung converted? If not how can I create one? Thanks
                                • Zoho Projects is down

                                  Is anyone else having problems getting to Zoho Projects?   We are getting a Zoho server error, impacting our business.... I thought Zoho had HA for their Applications!?
                                • Develop and publish a Zoho Recruit extension on the marketplace

                                  Hi, I'd like to develop a new extension for Zoho Recruit. I've started to use Zoho Developers creating a Zoho CRM extension. But when I try to create a new extension here https://sigma.zoho.com/workspace/testtesttestest/apps/new I d'ont see the option of Zoho Recruit (only CRM, Desk, Projects...). I do see extensions for Zoho Recruit in the marketplace. How would I go about to create one if the option is not available in sigma ? Cheers, Rémi.
                                • Zoho Payroll [India Edition] - ICICI Bank Integration

                                  It seems that ICICI integration with Payroll (and other Zoho apps) has become progressively more difficult this year. It was great until last year but then some apps started requiring a token generated on ICICI website. The whole point of Direct Deposit
                                • Issue with EU MArketplace

                                  Hi It's super frustrating that many CRM / Zoho (whatever) extensions are not available in the EU Market place Example: https://marketplace.zoho.com/app/crm/time-tracker-extension-for-zoho-crm For now, can the team address the extension above, but on the
                                • Add an action to set agent as a member of a team in zoho desk

                                  Hi, Please add an action to zoho flow to set agent as a member of a team in zoho desk (add to a team or remove from a team). Regards, Ram
                                • Cant add owner to field update in workflow

                                  Hi there, Currently when i tried to add owner of the record of the module to the field update, i am unable to. Is there a way to do so?
                                • Zoho Books API Limit Is RIDICULOUS!!!!!!!!!!!!!

                                  The 2,500 API call limit in Zoho Books is about as useful as AOL dialup.  Seriously Zoho, not only can I use up 2,500 API calls in no time with my own app but YOUR OWN STUPID IPAD APP blows through them super fast too, so if any one of my clients wants
                                • CRM portal users can now log in using their mobile phone numbers

                                  Hello everyone! You can now invite portal users using their mobile phone numbers. These portal users will be able to log in using their mobile number and OTP. Templates for these portal-related SMS can be customized as per your needs. This enhancement
                                • Zoho CRM: Las últimas novedades de 2024. ¡No te las pierdas!

                                  ¡Hola, Español Zoho Community! Aunque sabemos que en estas fechas muchos de vosotros estáis ya disfrutando de un merecidísimo descanso, no queríamos acabar el año sin haceros un resumen de las actualizaciones más interesantes de los últimos tres meses,
                                • Assistance Required: Custom Model Record Not Visible in Zoho CRM Sandbox

                                  Dear Team, I hope this message finds you well. I have created a custom model in the Zoho CRM Sandbox account and am currently adding records to it using Python. While I am able to fetch the module data programmatically through Python, I am unable to see
                                • Automatic Updates for Zoho Desk Extensions

                                  Dear Zoho Desk Team, I hope you're doing well. We would like to request the addition of an automatic update feature for Zoho Desk extensions. Currently, updating extensions requires manually searching for updates and clicking the update button. This process
                                • Dialing Microsoft Teams Phone Service via Zoho CRM

                                  I am using the VOIP option in Microsoft teams for my office phone system. I was hoping to have a way to dial numbers directly from Zoho CRM, but don't see anything in the Teams Integration or in the Telephony integration that will enable this. Does anyone
                                • Next Page