Power of Automation :: Autocomplete the Project upon Task closure.

Power of Automation :: Autocomplete the Project upon Task closure.

Hello Everyone,

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.

Requirement:

One of our customers wanted to update the status of the Project to Completed automatically once all the Tasks were closed. This can be achieved using Task Custom Functions along with Workflow rules in Zoho Projects. 
 
Custom function code:-
 
paramMap = Map();
paramMap.put("index",0);
paramMap.put("range",2);
paramMap.put("status","notcompleted");
getAllTasks = zoho.projects.getRecords(portalId,projectId,"Tasks",paramMap,0,"projects");
if(getAllTasks.isEmpty())
{
updateStatusName = "zp.projstatus.completed";
projectDetails = invokeurl
[
url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/"
type :GET
connection:"XXXXX"
];
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 :projectsAPIEndPoint + "/portal/" + portalId + "/module/projects/layouts/" + projectLayoutId + "/"
type :GET
connection:"XXXXX"
];
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(updateStatusName))
{
updateProjectParamMap = Map();
updateProjectParamMap.put("custom_status",statusMap.get(updateStatusName));
projectDetail = invokeurl
[
url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/"
type :POST
parameters:updateProjectParamMap
connection:"XXXXX"
];
info projectDetail;
info "-------------------------------------";
}
}
}
return "success";
 
Make sure to replace XXXXX with the Zoho Projects connection link name along with scopes: ZohoProjects.portals.READ, ZohoProjects.projects.UPDATE, ZohoProjects.projects.READ, ZohoProjects.tasks.READ.

Check this link to learn how to create the connection. Please find the screenshot of the parameters to be mapped and sample Task workflow rules.

With the custom function code provided above, our customer effectively utilised Task custom functions in Zoho Projects which allowed them to automate Project completion, reducing time consumption and in turn increasing their business productivity.

We hope you found this post useful. If you have any questions, feel free to share them in the comments below.


      Zoho Campaigns Resources


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

          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 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

                                  • CRM for Everyone - More Actions Option to Create Record

                                    Please consider the option create a new record for the module from the More Actions menu. I know there is an "Add New" icon further down the menu to create a record for any module, but this just seems more intuitive and could reduce the need for the "Add
                                  • Zoho books partners: Transferwise, Resolut

                                    Can anyone tell me if Transferwise and/or Resolut (payment systems) are in integrated?  I know PayPal and Google are, but in Europe we like Transferwise and Resolut is an up and coming multi-currency app. Xero and Transferwise are fully compatible. Thanks
                                  • Getting oauth errors on bigin

                                    Hi Support, I'm getting oauth errors on bigin even though it works fine with CRM. I created a self client which will add contacts. I gave every permission you could and it still didn't work. What should I do. I might just switch to the standard CRM since
                                  • Assessment Field in Custom View

                                    Zoho recruit finally added the ability to filter Job Applications by Assessment Answers This is a very valuable addition to the Recruit But this is currently missing from the custom view This should be added to the custom view as well
                                  • Name Change and Delete Email ID and Alias

                                    Hello please i require urgent assistance, 1.) I would also like to change the name that appears when people receive my emails. I have an info@spacetraiders.com but when people receive my email its say Ronma Adedeji instead of either Info or Space Traiders..
                                  • Feature Requests and enhancements: Subform

                                    By The Grace of G-D. Hi, It would make it much easier to use if we could have some more features in subforms: More Columns/Fields Set the size of a column Show the subform in Full Page Width Sorting By Column Please consider The above suggestions. T
                                  • Unapplied AP Credits not showing up on AP Detail Aging

                                    I am new to using Zoho Books. I was reconciling some accounts and found differences from the GL balance and AP Aging and it came down to unapplied vendor credits. Is there an option to include that on the report, so I can pull a matching AP Aging to the
                                  • Add Entry and Subform Record from Deluge Scripts

                                    Hi all,  I would like to know how do I add a new entry and also subform records from a deluge scripts.  I can use the insert into to add a new entry to a form, but how do i insert a collection into the subform of the entry? I am using a deluge script
                                  • Finding draft ticket replies

                                    Is there a way to see all tickets which have draft replies?
                                  • How to apply a tag to a ticket based on the to email address?

                                    I need to assign a tag to a ticket if the ticket was sent to a specific email address. For example, we have the email accounting[at]company.com forwarding into Zoho Desk. We would like all emails that were sent to this address to be tagged with an Accounting
                                  • Engineering Change Order Process using Tickets?

                                    Hi Zoho Community, I'm working with my company to create an Engineering Change Order/Request (ECO/ECR) process where engineers can internally create tickets for changes in a product that must be reviewed, approved and implemented by people or teams in
                                  • How can I move a ticket from Department A to Department B?

                                    Hi there, how do I move ticket from Department A to Department B? I went in the ticket and tried to scroll down the menu under the "department" but it won't let me, I am a support admin. Did I do anything wrong? or am I doing it in the wrong place?
                                  • Validation Rules Trigger on Untouched Fields

                                    In Zoho Desk, validation rules trigger for ALL fields during an update—even fields that weren't modified in the current edit. This behavior is fundamentally different from Zoho CRM and other Zoho products, where validation rules only apply to fields actually
                                  • How to work with getFieldNames formdata functions ,Any Examples

                                    I don't find any example showing usage of getFieldNames. Where do i find .is there any Help documents available
                                  • Zoho Notifications - Received two notifications for one message and none for the other

                                    We had a client reply to a ticket twice in one minute. The ticket owner received two emails for the second message but none for the first (which was crucial content and unfortunately was therefore missed). I'm assuming this created a race condition -
                                  • What is the difference between "Reply" and "Public Comment" in a ticket?

                                    Hey, my company is thinking about switching to Zoho Desk but we do not understand the difference between the "Reply" and the "Public Comment" feature. When should we use which? And why? What is the difference between them? Thank you for your help! Kindest
                                  • Tasks View for Opportunity/Jobs does not indicate "Related To" account

                                    How can ZoHo be setup so that when a task is created for an Opportunity, the subject automatically lists the underlying account? Right now, it's impossible to link the Account to the task when the task is created from the Job.  Therefore, the open task view is inadequate.  And it's a lot of maintenance to have to manually add the account to the subject...defeating the purpose of "Automated" workflow. 
                                  • can i show alert when i finish running the function?

                                    how i can show alert inside the custom function or popup notification. when i use alert inside the custom function it show this error Error at line number:  2 'ALERT' task can be used only in on load, on validate and on change actions ​
                                  • CRM calendar not syncing with Zoho Calendar

                                    The sync is not happening: This is my Zoho Calendar CalDAV synced with Outlook This is my Zoho CRM Calendar (sadly empty ...) I have enabled CalDAV Access. In Zoho Calendar, I have set up APP Calendar sync like this: What else can I check? Thank
                                  • Pipeline in Custom Modules

                                    I love the way the Sales Pipeline looks and functions with reports. I would like to add the save pipeline features and visualization to a custom module, however, I only see that these pipelines are only available for the Deals module. Is there a way to add pipelines to custom modules?
                                  • Cannot associate event with other objects when creating?

                                    I am attempting to associate an Event with one or more other objects when creating it via the API. According to the API docs, the "Related_To" property is a jsonobject even though the description says "Provide the details about the entities the event
                                  • How to disable subform records dynamically

                                    Hi Everyone I have a requirement to dynamically disable or hide subform fields based on certain criteria. However, the code I tried didn't work as expected. It either disabled or hid all the fields in all subform records or none at all. What I actually
                                  • Client Script Operate Timeout

                                    Hi Zoho, I have set a client script that use for ( i =1; length < i , i++) to fetch all of the product in order I have an order have 30+ products, seems this script will be stopped when it is checking rough 10 + products because of timeout (may be). May
                                  • Why and When to Manually Regenerate Reports?

                                    What is the protocol for needing to regenerate reports?  It is very confusing when data in reports pulls correctly sometimes, but are inaccurate other times.   Why is report regenerating necessary at all - can the report function not read the live data as inputted into the forms?  We have built lots of reports and it is very tedious and time consuming to have to regenerate the report before each use of that data to make sure it is accurate.  Is there a way to know when a report should or shouldn't
                                  • Import template from Zoho Writer

                                    I am trying to import a mail merge template - tried to import direct from my .docx file on my hard drive and the formatting went all over the place. I then imported the .docx file in my Zoho Docs and then fixed up the formatting within Zoho Writer. Can
                                  • Button Duplication when emails forwarded or replied

                                    When I create a new email template in campaigns and send it out it looks fine to all the users, however if that email is then on forwarded or replied to then all buttons within the email duplicate.  See below The one on the left is the original one.
                                  • Enhancements to Custom Connectors in Zoho Creator

                                    Hello everyone, At Zoho Creator, we believe in providing you with the necessary tools to achieve a well connected ecosystem of apps. Our Custom Connectors feature is a testament to this, enabling you to integrate with a wide range of external services
                                  • AutoScan Not Working Since April -Support says it with engineering

                                    Hi there, Autoscan has not been working on my account since April. Without this feature, completing expenses reports is laborious and error-prone. I keep asking for updates seeing as this is a critical feature, but told that it's being looked into and
                                  • Zoho books bulk update for invoices

                                    Hi Zoho team, Why only 25 invoices can be bulk update at a time. I am booking 800 to 900 invoices in a month. Please increase this limit? Please dont tell that you dont have enough request for this task. 25 limit for bulk update is too much low
                                  • Querying CloudSQL using NodeJS?

                                    How can I query CloudSQL over nodejs? Are there any rest apis from which I perform Select Queries in the data of a Workspace? In the v1 we had C#, Python, Java for CloudSQL Now I only see Java? I am confused about the overall API of Analytics, there any
                                  • Rename Record Templates in Zoho Creator

                                    Hi Team, I need to rename the Record Templates based on the name of the employee which i have configured in Zoho Creator Deluge Script. How to do this one? // Attachments :template:PDF_ECF:Exit_Clearance_Form input.ID as PDF
                                  • Les Zoholics 2025 sont de retour

                                    Bonjour à tous, Préparez-vous pour deux jours exceptionnels au cœur de l’écosystème Zoho ! Nous avons le plaisir de vous convier à Zoholics France 2025, un événement dédié à l’innovation, à l’expertise et à la communauté Zoho. Au programme : • Présentations
                                  • Salutation

                                    Hey there, I want to make an indvidual salutation. It is possible to use if statements in the email templates? For exampe: When is male then wirte "Dear Mr." else write "Dear Mrs." Thanks David
                                  • Personal Expenses

                                    I have reviewed the board and found a few scenarios like mine however not exactly so sorry if this is a re-post.  I just recently joined Zoho Books and had to go through 2000 transactions manually which took FOREVER. So the dilemma that I am facing is that I have attached my personal and business checking cards to my account because it was not until half way through 2015 that I decided to open up a business account as an independent contractor.  When I first started my account I placed the opening
                                  • Not receiving instagram verfication emails

                                    Hi- I'm not receiving Not receiving instagram verfication emails.  I have seen other users having the same issue and your answer was to contact instagram.  But instagram no longer has a support email.  
                                  • Change work hours per day for employees

                                    Hello, Is there a way to modify the work hours per day for employees in Zoho projects? This would be helpful for resource allocation to more accurately see when an employee who works 35 hours a week vs 40 hours has a full schedule. Thanks.
                                  • 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
                                  • PROBLEMA AL CONECTAR EL DOMINIO

                                    hola buenas tardes hoy estoy tratando de crear mi registro y no me deja conectar el dominio  me dice que el dominio ya está vinculado a una cuenta y la verdad no tiene conectado el dominio a ninguna cuenta  tengo acceso al hosting y cpanel que se compro pero al revisar los dns estan apuntando al mismo hosting del panel  del proveedor del domini ... como hago para poder crear la cuenta con ese dominio, incluso cree un registro pero no  me deja vincularlo el dominio es integrasoft.co agradezco me ayuden  
                                  • Delay in delivery of emails

                                    I'm experiencing random delays for emails sent from Zoho account. Headers show that the message reached mx.zohomail.com almost instantly, followed by a delay of anywhere from 3-15 minutes (and counting). Please confirm whether this is a system-wide
                                  • Zoho Mail not working. Constant OTP

                                    Firstly, my emails have been playing up for over a year. They are struggling to send and I have to press Send a few time to make them going. They mostly hover with a loading note saying Sending. I emailed Zoho and they got it working, but now it is doing
                                  • Next Page