Power of Automation :: Automatically Approve/Reject the associated timelogs of Issues

Power of Automation :: Automatically Approve/Reject the associated timelogs of Issues

Hello Everyone,


A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate complex tasks and calculations.

We have a few pre-defined gallery functions that are ready to use. You can access the same using the steps available in this link.        

QuoteThis week, I would like to highlight one of the Gallery custom functions - Approve / Reject Associated TimeLog Entries   
 
Use case:-

This function helps you to automatically approve/ reject the timelogs associated to the issues based on the value provided in the Argument. To automate this action, you can associate this custom function to Business Rules.

Todo:-

Create a connection for the Zoho Projects service with the scopes "ZohoProjects.timesheets.READ, ZohoProjects.timesheets.UPDATE" to replace 'xxxxx' with the connection name. Click this link below to learn how to create the connection. Refer the attached screenshot of the Arguments.

Custom function code:-
projectsDomain = "https://projectsapi.zoho.com";
// approveStatus = approved | rejected for rejected status note is mandatory.
getAssociatedTimelogEntriesAPI = projectsDomain + "/api/v3/portal/" + portalId + "/projects/" + bugProjectId + "/timesheet";
getAssociatedTimelogEntriesParam = Map();
getAssociatedTimelogEntriesParam.put("page",1);
getAssociatedTimelogEntriesParam.put("per_page",200);
getAssociatedTimelogEntriesParam.put("view_type","projectspan");
moduleJson = Map();
moduleJson.put("id",bugId);
moduleJson.put("type","issue");
getAssociatedTimelogEntriesParam.put("module",moduleJson);
info getAssociatedTimelogEntriesParam.toString();
info getAssociatedTimelogEntriesAPI;
getAssociatedTimelogEntriesResp = invokeurl
[
url :getAssociatedTimelogEntriesAPI
type :GET
parameters:getAssociatedTimelogEntriesParam
connection:"xxxxxxxxx"
];
info getAssociatedTimelogEntriesResp;
if(getAssociatedTimelogEntriesResp != null && getAssociatedTimelogEntriesResp.get("time_logs") != null)
{
updateLogHoursStatusAPI = projectsDomain + "/api/v3/portal/" + portalId + "/logs";
logEntriesList = List();
bugTimeLogEntries = getAssociatedTimelogEntriesResp.get("time_logs");
for each  timeLog in bugTimeLogEntries
{
logDetails = timeLog.get("log_details");
for each  logDet in logDetails
{
logId = logDet.get("id");
logMap = Map();
logMap.put("approval_status",approvalStatus);
logMap.put("id",logId);
logMap.put("module","issue");
logNote = Map();
logNote.put("notes",approvalNote);
logMap.put("extra_data",logNote);
logEntriesList.add(logMap);
}
}
payload = "[" + logEntriesList + "]";
updateLogStatusResp = invokeurl
[
url :updateLogHoursStatusAPI
type :PATCH
parameters:payload
connection:"xxxxxxxxx"
];
info updateLogStatusResp;
}


Creating custom functions in Zoho Projects is straightforward and well-documented. Zoho provides a range of built-in functions that you can use as a starting point, and you can also easily define your own functions using Zoho's scripting language, Deluge. Give it a try and see how it can save your time and boost your productivity!


Watch this space for more such custom function codes. 


      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

          • Automation Series: Auto-create Dependent Task on Status Change

            In Zoho Projects, you can automatically create and assign a dependent task when a task’s status is updated. This helps teams stay aligned, ensures reviews happen on time, and reduces manual effort. In this post, we’ll walk through an easy setup using
          • Time Log Reminder

            Tracking the time spent on tasks and issues is one of the most important functions of a timesheet. However, users may forget to update the time logs because they have their own goals to achieve. But, time logs must be updated at regular intervals to keep
          • Introducing the Zoho Projects Learning Space

            Every product has its learning curve, and sometimes having a guided path makes the learning experience smoother. With that goal, we introduce a dedicated learning space for Zoho Projects, a platform where you can explore lessons, learn at your own pace,
          • Update on V2 API End-of-Life Timeline

            Dear Users, Earlier this year, we shared the launch of the V3 APIs and requested users to migrate from the older V2 APIs by December 2025. We have received valuable feedback from our users and partners regarding their migration timelines. We are happy
          • Automation Series: Auto-update Phase Status

            Hello Folks! You can auto-update your phase's status based on status of underlying tasks using custom functions. In this series, we will showcase how to create and run custom functions, using Deluge, with ease. Follow the steps below and automate your

          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

                                  • Can't edit Segments

                                    Happening with 2 different Zoho One environments, in different browsers. Please fix.
                                  • Zoho Sheet for Desktop

                                    Does Zoho plans to develop a Desktop version of Sheet that installs on the computer like was done with Writer?
                                  • From Zoho CRM to Paper : Design & Print Data Directly using Canvas Print View

                                    Hello Everyone, We are excited to announce a new addition to your Canvas in Zoho CRM - Print View. Canvas print view helps you transform your custom CRM layouts into print-ready documents, so you can bring your digital data to the physical world with
                                  • Transfer ownership of files and folders in My Folders

                                    People work together as a team to achieve organizational goals and objectives. In an organization, there may be situations when someone leaves unexpectedly or is no longer available. This can put their team in a difficult position, especially if there
                                  • Consumer Financing

                                    Does Zoho currently have a payment gateway (such as Stripe, Square, etc) which offers financing for customers? So, let's say the estimate we give the customer is greater than what they can afford at the time, but we can sell the service now, letting them
                                  • How can Data Enrichment be automatically triggered when a new Lead is created in Zoho CRM?

                                    Hi, I have a pipeline where a Lead is created automatically through the Zoho API and I've been trying to look for a way to automatically apply Data Enrichment on this created lead. 1) I did not find any way to do this through the Zoho API; it seems like
                                  • validation rules doesn't work in Blueprint when it is validated using function?

                                    I have tried to create a validation rule in the deal module. it works if I try to create a deal manually or if I try to update the empty field inside a deal. but when I try to update the field via the blueprint mandatory field, it seems the validation
                                  • Subform edits don't appear in parent record timeline?

                                    Is it possible to have subform edits (like add row/delete row) appear in the Timeline for parent records? A user can edit a record, only edit the subform, and it doesn't appear in the timeline. Is there a workaround or way that we can show when a user
                                  • Zoho CRM - Option to create Follow-Up Task

                                    When completing a Zoho CRM Task, it would be very helpful if there was an option to "Complete and Create Follow-Up Task" in the pop-up which appears. It could clone the task you are closing and then show it on the screen in edit mode, all the user would
                                  • Mandatory Field - but only at conversion

                                    Hello! We use Zoho CRM and there are times where the "Lead Created Date & Time" field isn't populated into a "Contractor" (Account is the default phrase i believe). Most of my lead tracking is based on reading the Lead Created field above, so it's important
                                  • Zoho CRM for Everyone's NextGen UI Gets an Upgrade

                                    Hello Everyone We've made improvements to Zoho CRM for Everyone's Nextgen UI. These changes are the result of valuable feedback from you where we’ve focused on improving usability, providing wider screen space, and making navigation smoother so everything
                                  • File Upload field automatically replaces spaces with underscores – support experience

                                    Hi everyone, I want to share my recent experience regarding the File Upload field behavior in Zoho Creator and my interaction with the Zoho support team. When a user uploads a file, the system automatically renames the document by replacing spaces in
                                  • Deluge function to copy parent record file upload field to child record file upload field

                                    I'm stuck trying to write a deluge function that is triggered via automation in child record "Appointments," confirms if a file is in file upload "Report" field of parent "Contacts" record via Contacts lookup field "Contact_Name". If no file is in parent
                                  • Zoho Books Sandbox environment

                                    Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
                                  • Make panel configuration interface wider

                                    Hi there, The same way you changed the custom function editor's interface wider, it would be nice to be able to edit panels in pages using the full width of the screen rather than the currently max-width: 1368px. Is there a reason for having the configuration panel not taking the full width? Its impossible at this width to edit panels that have a lot of elements. Please change it to 100% so we can better edit the layouts. Thanks! B.
                                  • Image Compression Options

                                    Much better if we have level of options to compress the image [20%, 40%...] We are dealing with service reports daily that has before and after photos (image field)- the file size too large and one thing, the current limit is 10mb or 15mb for report
                                  • Cannot get code to work with v2.mergeAndStore!

                                    Please can someone help me pass subform items into a repeating mail merge table row using v2.mergeAndStore? I have a mail merge template created in Writer and stored in Workdrive. This template is referenced by a custom CRM function which merges all of
                                  • How to hide or archive a blog post temporarily in Zoho commerce website builder?

                                    I would like to temporarily hide or archive a blog post in zoho commerce website builder so that it doesnt appear on my website till I enable it again. I tried to look for this option but could not find it.  It only allows me to permanently delete a blog
                                  • Founders using Zoho — are you leveraging Zoho Campaigns + Zoho Social for thought leadership… or just sending emails?

                                    I’ve noticed something interesting in the Zoho ecosystem. Many founders use Zoho Campaigns and Zoho Social for basic marketing—newsletters, scheduled posts, and announcements. But very few are using these tools strategically to: • Position themselves
                                  • WATERFALL CHART IN ZOHO ANALYTICS

                                    Hi Team, I would like to know whether Zoho Analytics currently supports a Waterfall Chart as a built-in visualization type. If yes, could you please share the steps to create one? If not, is there any workaround or recommended method to build a Waterfall
                                  • How to mix different types of inputs (such as dropdown list and textbox)

                                    Hi, I'm creating a form called "Room Reservations" for a company. I created a "table" using "Matrix Choice". I created "Room 1", "Room 2" and "Room 3" with the "Questions". I would then like to create two columns with the "Answers", one called "Department"
                                  • Full Context of Zoho CRM Records for Zia in Zoho Desk for efficient AI Usage

                                    Hello everyone, I have a question regarding the use of Zia in Zoho Desk in combination with CRM data. Is it possible to automatically feed the complete context of a CRM record into Zia, so that it can generate automated and highly accurate responses for
                                  • Ability to assign Invoice Ownership through Deluge in FSM

                                    Hi, As part of our process, when a service appointment is completed, we automated the creation of the invoice based on a specific business logic using Deluge. When we do that, the "Owner" of the invoice in Zoho FSM is defaulted to the SuperAdmin. This
                                  • Reply to Email for SO/PO

                                    Hello, We are new to Zoho Books and running into an issue. Our support@ email is our integration user. When our team is sending out PO/SO's we are updating the sender email, but for some reason many of our responses are coming back to our support@ email
                                  • How to Convert NSF to PST Format Effortlessly? - SYSessential

                                    It is highly recommended to obtain the error-free solution of the SYSessential NSF to PST converter to convert NSF files from Lotus Notes. Using this professional software, it becomes easier to convert all NSF database items, including emails, journals,
                                  • Zoho Commerce - Poor Features Set for Blogging

                                    Hi Zoho Commerce team, I'm sure you will have noticed that I have been asking many questions about the Blogs feature in Commerce. I thought that it would be useful if I share my feedback in a constructive way, to highlight the areas which I feel need
                                  • Pass shipping info to payment gateway Zoho Books to Authorize.net

                                    For some reason the integration from Zoho books to Authorize.net does not pass the shipping address. Authorize.net is ready to receive it, but zoho books does not send it
                                  • Massive Zoho Books failure

                                    We have not received any communication or notification from Zoho, but we have detected that Zoho Books is not working for all our users. We cannot access or use Zoho Books. This is critical. We are trying to contact Zoho on the Spain telephone number,
                                  • Does the Customer “Company Name” field appear anywhere in the Zoho Books UI outside of PDFs?

                                    Hi everyone, I’m trying to understand how the Company Name field is actually used in Zoho Books. There is a Company Name field on the customer record, but when viewing transactions like a Sales Order in the normal UI (non-PDF view), that field doesn’t
                                  • Email outbox is now available in the sandbox

                                    Hello all! Testing emails without visibility has always been a blind spot in the sandbox. With the new Outbox, that gap is closed. You can now view and verify every email triggered from your sandbox, whether it’s through workflows, approvals, or mass
                                  • Zoho Desk blank screen

                                    opened a ticket from my email, zoho desk comes up blank, nothing loads. our receptionist also gets the same thing under her login on her computer. our sales rep also gets same thing on zoho desk at his home on a different computer. I tried clearing cache/history/cookies,
                                  • Looking For Recruit Developer

                                    Hi everyone, I am looking for a Zoho Certified Developer to assist with a development project for MetalXpert. We are building a software system designed to bridge the gap between a candidate mobile app and an employer web portal using Zoho Recruit as
                                  • sales IQ issue on website

                                    i integrated the zoho sales IQ code on the website but it is comming in distroted form i am sharing the screenshot below the website is bulit in wix platform
                                  • Multi-currency and Products

                                    One of the main reasons I have gone down the Zoho route is because I need multi-currency support. However, I find that products can only be priced in the home currency, We sell to the US and UK. However, we maintain different price lists for each. There
                                  • Deprecation of the Zoho OAuth connector

                                    Hello everyone, At Zoho, we continuously evaluate our integrations to ensure they meet the highest standards of security, reliability, and compliance. As part of these ongoing efforts, we've made the decision to deprecate the Zoho OAuth default connector
                                  • I need to know the IP address of ZOHO CRM.

                                    The link below is the IP address for Analytics, do you have CRM's? IP address for Analytics I would like to know the IP address of ZOHO CRM to allow communication as the API server I am developing is also run from CRM. Moderation Update: The post below
                                  • Important Update: Google Ads & YouTube Ads API Migration

                                    To maintain platform performance and align with Google's newest requirements, we are updating the Google Ads and YouTube Ads integrations by migrating from API v19 to the newer v22, before the official deprecation of v19 on February 11, 2026. Reference:
                                  • Importing into the 'file upload' field

                                    Can you import attachments into the file upload field. I would expect it to work the same way as attachments do, But can't seem to get it to work.
                                  • Zoho recruit's blueprint configuration is not functioning as mapped

                                    Current Status: Zoho Blueprint is not functioning as configured. Issue: We are moving a Candidate status in Zoho Recruit "for active file" but we encountered: "Status cannot be changed for records involved in Blueprint." This happens to various client
                                  • Super Admin Logging in as another User

                                    How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Moderation Update (8th Aug 2025): We are working
                                  • Next Page