Power of Automation :: Automatically approve the pending timelogs at your preferred time

Power of Automation :: Automatically approve the pending timelogs at your preferred time

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. 


Below is the requirement:


Our customer approached with the below requirement - They want an automation that all the pending timelogs should be automatically approved in the first week of every month. Likewise, it is possible to configure as per your preferred time.

We had accomplished this requirement using Schedule functions. This allows you to execute custom functions based on a specified schedule such as hourly, daily, weekly, or monthly. This feature can be used for recurring actions, like generating monthly reports or sending automated emails to portal users about upcoming public milestones or deadlines without relying on specific events.


Create a connection for the Zoho Projects service with the scopes "ZohoProjects.timesheets.ALL' to replace ‘projects’ with the connection name. Click this link below to learn how to create the connection. Attached a screenshot of the Schedule Function for reference.


Script to be used:


endPointV3 = "https://projects.zoho.com/api/v3/portal/";

logParamList = List();

moduleTemplate = Map();

moduleTemplate.put("type","task");

timesheetParam = Map();

timesheetParam.put("view_type","month");

timesheetParam.put("module",moduleTemplate);

timesheetParam.put("start_date",zoho.currentdate.addMonth(-1));

timesheetParam.put("end_date",zoho.currentdate);

taskTimesheetResponse = invokeurl

[

url :endPointV3 + portalId + "/timesheet"

type :GET

parameters:timesheetParam

connection:"projects"

];

// info taskTimesheetResponse;

if(taskTimesheetResponse != null)

{

for each  time_log in taskTimesheetResponse.get("time_logs")

{

for each  logs in time_log.get("log_details")

{

logDetail = Map();

logDetail.put("approval_status","approved");

logDetail.put("module","task");

logDetail.put("id",logs.get("id"));

logParamList.add(logDetail);

}

}

}

genralLogIds = Map();

moduleTemplate.clear();

timesheetParam.remove("module");

moduleTemplate.put("type","general");

timesheetParam.put("module",moduleTemplate);

generalTimesheetResponse = invokeurl

[

url :endPointV3 + portalId + "/timesheet"

type :GET

parameters:timesheetParam

connection:"projects"

];

// info generalTimesheetResponse;

if(generalTimesheetResponse != null)

{

for each  time_log in generalTimesheetResponse.get("time_logs")

{

for each  logs in time_log.get("log_details")

{

logDetail = Map();

logDetail.put("approval_status","approved");

logDetail.put("module","general");

logDetail.put("id",logs.get("id"));

logParamList.add(logDetail);

}

}

}

issueLogIds = Map();

moduleTemplate.clear();

timesheetParam.remove("module");

moduleTemplate.put("type","issue");

timesheetParam.put("module",moduleTemplate);

issueTimesheetResponse = invokeurl

[

url :endPointV3 + portalId + "/timesheet"

type :GET

parameters:timesheetParam

connection:"projects"

];

// info issueTimesheetResponse;

if(issueTimesheetResponse != null)

{

for each  time_log in issueTimesheetResponse.get("time_logs")

{

for each  logs in time_log.get("log_details")

{

logDetail = Map();

logDetail.put("approval_status","approved");

logDetail.put("module","issue");

logDetail.put("id",logs.get("id"));

logParamList.add(logDetail);

}

}

}

approveTimesheets = invokeurl

[

url :endPointV3 + portalId + "/logs"

type :PATCH

parameters: "["+logParamList.toString()+"]"

connection:"projects"

];

info approveTimesheets;

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. 


    Access your files securely from anywhere

          Zoho FSM Video Tutorials


                All-in-one knowledge management and training platform for your employees and customers.






                                      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

                                                                      • DYK 14: Create Tasks with AI

                                                                        Did you know AI can suggest tasks within your Zoho Projects portal? Breaking a project into clear, actionable work items takes time and manual effort. Especially when the same team handles both planning and execution. AI task suggestions in Zoho Projects
                                                                      • Introducing CodeX Scripts for Custom Modules

                                                                        When a project involves processes beyond the usual modules such as tasks and issues, teams often create Custom Modules to keep information organized in a way that fits their workflow. Once those records become part of the process, there may also be specific
                                                                      • Create Custom Module Using AI in Zoho Projects

                                                                        Every team has its own way of managing work. While standard modules support common project management needs, many business processes require their own structure, fields, and terminology. With AI-powered Custom Modules in Zoho Projects, users can create
                                                                      • Collaborate Visually with Whiteboard in Zoho Projects

                                                                        Whiteboard in Zoho Projects allows you to collaborate visually by creating diagrams, annotating designs, and sketching project workflows using shapes, text, and images within project modules. Team members can work simultaneously, improving productivity
                                                                      • Create Flexible Layouts with Layout Rules

                                                                        In a project, when a work moves from planning to execution, the information teams need can change at every stage. A project can need one set of details, a phase can need another, and a custom process may require an entirely different set of information.


                                                                      Manage your brands on social media



                                                                            Zoho TeamInbox Resources



                                                                                Zoho CRM Plus Resources

                                                                                  Zoho Books Resources


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

                                                                                                        Get Started. Write Away!

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

                                                                                                          Zoho CRM コンテンツ


                                                                                                            Nederlandse Hulpbronnen


                                                                                                                ご検討中の方





                                                                                                                          • Recent Topics

                                                                                                                          • Enhanced Zoho CRM and Office 365 calendar synchronization features!

                                                                                                                            Dear customers, We're excited to share some significant improvements to our Office 365 calendar synchronization features, aimed at providing you with more control and a more personalized experience. What’s new Choose your Office 365 calendar: During the
                                                                                                                          • What are the best practices for managing tax records and financial information for a small business?

                                                                                                                            I’m interested in learning how other small business owners and accounting professionals organize their financial records and prepare for tax filing. With bookkeeping, expense tracking, income records, and tax documents all needing to stay accurate, having
                                                                                                                          • How to Open Google Takeout and Thunderbird MBOX Files?

                                                                                                                            MBOX files are used by email clients and services, such as Google Takeout and Mozilla Thunderbird, to store email messages. It can, however, be difficult to open such files if you don't have an email programme that is compatible. Google Takeout enables
                                                                                                                          • Convert MBOX to PDF Free on Mac and Windows

                                                                                                                            MBOX files are widely used for storing email messages in email clients such as Thunderbird, Apple Mail, and other programs that support the MBOX format. Although this format is useful for handling emails, it can at times be inconvenient to access the
                                                                                                                          • How to Convert Apple Mac Mail to PST for Outlook for Free?

                                                                                                                            Apple Mail is a widely used email program among Mac users, but what do you do if you want to transfer your emails to Microsoft Outlook? In such a situation—for example, when you are moving from a Mac to a Windows computer or when you need to use Outlook
                                                                                                                          • Cannot apply tags to multiple items at once

                                                                                                                            It is very frustrating needing to apply tags to notes individually. Even worse that it takes multiple clicks to do it. Can there please be an update to: 1.) Allow us to apply tags to batches of notes in one go. 2.) Make it less clicks to add a tag 3.)
                                                                                                                          • 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,
                                                                                                                          • not able to convert pdf to jpg and other forms and vice versa.

                                                                                                                            i want to change my pdf to jpg, word, etc and some times jpg to pdf. i don't know how to do in this.
                                                                                                                          • Changing an existing item to different accounts & inventory-tracked

                                                                                                                            Hi everyone, I have an item in Zoho Books that was originally set up as a non-inventory item. Over time, I associated it with different sales and purchase accounts, and I now have many invoices, bills, and reports that use this item. My business process
                                                                                                                          • Address limits per customer by edition

                                                                                                                            I’m on the Standard edition and have reached a limit of 30 addresses under a single customer. Before I move to an annual Professional subscription, I need to confirm the following: What is the maximum number of addresses allowed under one contact, and
                                                                                                                          • How to Convert Emails to PDF Format in Batch

                                                                                                                            It is helpful to convert emails into PDF format when you want to save important messages, when you need to share business correspondence, or when you wish to keep email records for future reference. PDF files can be readily opened, printed, and shared
                                                                                                                          • Months of WooCommerce–Zoho Inventory sync failures and repeated support requests – has anyone experienced this?

                                                                                                                            Months of WooCommerce–Zoho Inventory sync failures and repeated support requests – has anyone experienced this? I run a small retail business using WooCommerce and Zoho One. For months, I have been trying to resolve recurring synchronisation failures
                                                                                                                          • Function #24: Automatically display deal name from Zoho CRM on quotes in Zoho Books

                                                                                                                            Deals allow businesses to organize and visualize their sales pipeline. This provides a clear overview of all potential opportunities and helps in making informed decisions. Zoho CRM empowers you to create deals or potentials for your clients and monitor
                                                                                                                          • Lookups and Custom Modules

                                                                                                                            I created a Custom Module that I'm calling "Item Purchasing Group". This module will store information for groups of Items that must be purchased together (including minimum overall quantities and/or values, etc.). This will have a one-to-many relationship
                                                                                                                          • Zoho Books | Product updates | October 2026

                                                                                                                            Hello users, October brings a range of new features and enhancements to Zoho Books, designed to simplify compliance, streamline accounting workflows, and improve inventory management. From the launch of the Nigeria Edition and France’s e-invoicing capabilities
                                                                                                                          • Create custom rollup summary fields in Zoho CRM

                                                                                                                            Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
                                                                                                                          • Button or Links order

                                                                                                                            Is there a way to re-order the buttons or links that are created? Moderation Update: With our recent enhancement to custom button creation from the layout editor, administrators can now reorder custom buttons directly from the layout editor, and this
                                                                                                                          • Zoho Books | Product updates | August 2026

                                                                                                                            Hello users, July has been an exciting month for Zoho Books! This month, we're excited to introduce HTML PDF Templates, Placeholders as Pills, expanded approval workflows for Sales Returns and Journals, and significant compliance updates across the India,
                                                                                                                          • Bulk updating tags

                                                                                                                            My organisation handles a number of restricted funds. We previously did this by having a chart of accounts where each restricted fund has its own income and expense accounts. However, our accountant changed this, moving all transactions into accounts
                                                                                                                          • Download or Backup Bulk Emails from IMAP Server

                                                                                                                            Taking email messages from an IMAP server and saving them is a wise method for ensuring that important emails are kept safe and easy to access. No matter whether you have a business email address or a personal mailbox, keeping a local copy of your emails
                                                                                                                          • Zoho Writer Label Template Merge/Print Via API/Webhook/Flow

                                                                                                                            Short version of goal: To be able to kick off a Zoho Writer Label Template Document via API or Webhook or even using Zoho Flow. As of right now I have been unable to figure out a way to do that. Long version of goal: We would like to press a button (run
                                                                                                                          • Kaizen #263: Using Zoho CRM Skill to Build Widgets

                                                                                                                            Hello everyone! Welcome back to another exciting Kaizen post. In the previous Kaizen posts, we introduced the zoho-crm skill.md and explored how it can help with Zoho CRM APIs, Client Scripts, complex COQL queries, and Skill to build Queries. In this
                                                                                                                          • Zoho notebook No login

                                                                                                                            Hello Team, I recently downloaded and installed the latest version of zoho notebook for windows. But I am not able to login without providing any sso or email address. Did you removed the no login feature for this app? This is just a windows app. can
                                                                                                                          • Search is completely broken for PC

                                                                                                                            I go to note, try to search for "mtga" and it shows 702 results (it's a big note), highlights all letters "m" and I can't find anything. Same for "gathering" - it thinkgs I think only for "g". Looking for "zoho" shows as if I searched only for "z". Using
                                                                                                                          • Losing description after merging tickets

                                                                                                                            Hello, We merge tickets when they are about the same topic from the same client. It happens sometimes. We recently noticed that after the merger only the description from the master ticket is left in a thread. And the slave-ticket description is erased.
                                                                                                                          • Behind a great customer experience is a team

                                                                                                                            Hi everyone, October is here, and the first week marks the Customer service week. Each year, we thank our customer service professionals. Service professionals are all around us, even in our own workplaces: They handle essential administrative work like
                                                                                                                          • What's New - August and September 2026 | Zoho Backstage

                                                                                                                            Hello everyone, August and September bring a fresh wave of intelligence to Zoho Backstage. AI takes the spotlight with tools that help you create content, support attendees, and manage how AI fits into your events. Alongside AI, we’ve refined email communication,
                                                                                                                          • Images Not Displaying Properly in Zoho Desk

                                                                                                                            Hi, We are experiencing an issue with image rendering in Zoho Desk, affecting both incoming and outgoing emails. Images embedded in email conversations are not displaying properly. Instead, we see broken image icons or empty placeholders where the images
                                                                                                                          • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

                                                                                                                            We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
                                                                                                                          • Widget Height were destroyed

                                                                                                                            All widget heights in the Details Canvas view are broken. Moderation Update: This is a known issue with widget heights in Client Script popups and flyouts. A fix is in progress, and this post will be updated once it's released.
                                                                                                                          • Zoho Projects - Has something changed regarding to linking Projects and Deals via the API?

                                                                                                                            I am trying to link Zoho Projects to Deals in CRM using the API, but each time, the Deal Contact is added as a Client user and receives an email invite asking them to join the organisation. These are internal projects and the customer should not have
                                                                                                                          • How long does it take to review campaigns?

                                                                                                                            Hello Zoho, i scheduled my campaigns yesterday afternoon and it has been under review for over how many hours and those campaigns were supposed to be out yesterday so new ones can go out today. Is there something i'm doing wrong?
                                                                                                                          • Convert MSG to PDF in Bulk with Attachment Free

                                                                                                                            Microsoft Outlook saves each email as an MSG file, keeping with it key information like the sender, the recipient, the subject, the date, the body of the message, and any attachments. It can, however, be quite difficult to access a large number of MSG
                                                                                                                          • Using Mail Merge Template to Print Documents with One Subform Record's Fields per Document

                                                                                                                            Hello, We have a Mail Merge template created in Zoho Writer which is not able to perform the functionality which is currently required to automate the documentation task portion of our process. The CRM module we are primarily using is based on a "Loans"
                                                                                                                          • Convert MBOX to PST File Using Free Methods

                                                                                                                            MBOX is a mailbox format that is used by various email clients and services, such as Thunderbird, Apple Mail, Eudora, and Google Takeout. Yet, in order to be able to open your MBOX emails in Microsoft Outlook, you have to convert them from MBOX to PST
                                                                                                                          • Zoho Community Digest - September 2026 | Part 4

                                                                                                                            Hi everyone, and welcome back! The final week of September brought a revamped Books integration in Zoho CRM and Zoho Key Service for LLM access without API keys, Zoho Creator's audit trail becoming a full enterprise-grade auditing system, and Zoho One
                                                                                                                          • Automate weekly reports from Channels | Zoho Cliq AI use case #01

                                                                                                                            Scrolling endlessly through numerous threads in a Cliq channel and manually counting how many have been closed, how long people took to reply, and who actually participated can be tedious. After 20 minutes, you might have a number that no one can verify.
                                                                                                                          • Apple Mail to Outlook Converter - Export Apple Mac Mail to PST File

                                                                                                                            Apple Mail is a well-known email application among people who use Macs, whereas Microsoft Outlook is widely employed for both personal and business use. Should you decide to move from Apple Mail to Outlook, you'll probably need to transfer your mailbox
                                                                                                                          • Creator -Dynamic addition of Customer Portal User Licenses

                                                                                                                            Hi, We have a Creator App for B2C about to get released. We are experiencing the Portal User license challenge. Unable to predict the number of users who will download and Subscribe. When a User is about Subscribe and the portal licenses does not exists,
                                                                                                                          • Zoho Tables is now part of Zoho One!

                                                                                                                            Hey everyone! We've got some exciting news to share. Zoho Tables is now included in your Zoho One subscription at no extra cost. If you're already on Zoho One, head to your app list, add Zoho Tables, and get started right away. You don't need a separate
                                                                                                                          • Next Page