Automation#30: Auto-Update Time Entry to the Nearest 5 Minutes

Automation#30: Auto-Update Time Entry to the Nearest 5 Minutes



Hello Everyone, 

Time tracking is a feature in Zoho Desk to help businesses stay organized and efficient. For Zylker Techfix, this feature has helped to track the duration of gadget services to generate accurate bills.
However, Zylker Techfix faced a unique challenge: they needed to round off time entries for precise billing calculations. Manually adjusting each entry was time-consuming and prone to errors. A simple custom function helped in auto-adjustments in time entry.
Zylker Techfix automated the process of rounding time entries to the nearest 5 minutes. This not only saved time but also ensured accuracy in their billing operations.
In this week’s post, we share this custom function with you! 
Follow the steps below to set up your workflow rule and automate your time entries for seamless billing.

Prerequisites

1. Create a connection
  1.1 Go to Setup(S) and choose Connections under Developer Space.
  1.2 Click Create Connection.
  1.3 Select Zoho OAuth under Default Connection.
  1.4 Set the connection name as connection.
  1.5 Disable the toggle for User Credentials of Login User.
  1.6 Under Scope, choose the below scope values:
Desk.tickets.UPDATE
  1.7 Click Create and Connect.
  1.8 Click Connect and click Accept.
Connection is created successfully.

Create a Workflow Rule
1. Go to Setup, choose Workflows under Automation. 
2. Under Workflows, click Rules >> Create Rule.

In the Basic Information section,
3. Select Time Entry from the drop-down menu under Module.
4. Enter a Rule Name and Description for the rule.
5. If you want to activate the rule right away, select the Active checkbox. Else, create the rule and activate it later.
6. Click Next.
 
In the Execute on section, follow these steps:
7. Select Create.   
8. Click Next.
 
9. In the Criteria section, add criteria if required. click Next. 
10. In the Actions section, click the + icon and select New next to Custom Functions.
11. Enter a Name and Description for the custom function.                                           
12. In the script window, insert the Custom Function given below:
  1. //---------- User Input ------------
  2. roundOffValue = 5;
  3. deskURL = "https://desk.zoho.com"; // Replace .com based on your DC
  4. //----------------------------------
  5. logs = Collection();
  6. reminder = minutesSpent % roundOffValue;
  7. minutesSpent = minutesSpent - reminder + roundOffValue;
  8. params = Map();
  9. params.put("minutesSpent",minutesSpent);
  10. params.put("secondsSpent",0);
  11. params.put("hoursSpent",0);
  12. updateTimeEntry = invokeurl
  13. [
  14. url :deskURL + "/api/v1/tickets/" + ticketId + "/timeEntry/" + timeEntryId
  15. type :PATCH
  16. parameters:params.toString()
  17. connection:"connection"
  18. ];
  19. logs.insert("updateTimeEntry":updateTimeEntry);
  20. info logs;
Notes
NOTE
 In Line 3, Replace ".com" with the domain extension based on your Data Center.
13. Click Edit Arguments and include the argument mapping as below: 
13.1 In the Name field, type timeEntryId and select Time Entry Id under the Time Entry Section.
13.2 In the Name field, type ticketId and select Ticket Id under the Time Entry Section. 
13.3 In the Name field, type minutesSpent and select Minutes spent under the Time Entry Section. 
14. Click Done.  
15. Click Save to save the custom function.
16. Click Save again to save the workflow.
Info
Point to Remember 
This custom function rounds up the minutes in the Time Entry module. For example, 00:38:48 will be rounded up to 00:40:00, and 01:56:56 will be rounded up to 02:00:00.
We hope this custom function makes your time tracking smoother. We’d love to hear how this works for you! Share your feedback and connect with us for more tips and insights. Happy ticketing!

Regards,
Lydia | Zoho Desk

    Access your files securely from anywhere



                          Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts



                                                            • Sticky Posts

                                                            • Register for Zoho Desk Beta Community

                                                              With the start of the year, we have decided to take a small step in making the life of our customers a little easier. We now have easy access to all our upcoming features and a faster way to request for beta access. We open betas for some of our features
                                                            • Share your Zoho Desk story with us!

                                                              Tell us how you use Zoho Desk for your business and inspire others with your story. Be it a simple workflow rule that helps you navigate complex processes or a macro that saves your team a lot of time; share it here and help the community learn and grow with shared knowledge. 
                                                            • Tip #1: Learn to pick the right channels

                                                              Mail, live chat, telephony, social media, web forms—there are so many support channels out there. Trying to pick the right channels to offer your customers can get pretty confusing. Emails are most useful when the customer wants to put things on record. However, escalated or complicated issues should not be resolved over email because it's slow and impersonal.  When you need immediate responses, live chat is more suitable. It's also quick and convenient, so it's the go-to channel for small issues. 
                                                            • Welcome to Zoho Desk Community - Say hello here!

                                                              Hello everyone! Though we have been here for a while, it’s time to formally establish the Zoho Desk Community; we’re really happy to have you all here! This can be the place where you take a moment to introduce yourself to the rest of the community. We’d love to hear all about you, what you do, what company or industry you work for, how you use Zoho Desk and anything else that you will like to share! Here’s a little about me. I am Chinmayee. I have been associated with Zoho since 2014. I joined here
                                                            • Webinar 1: Blueprint for Customer Service

                                                              With the launch of a host of new features in Zoho Desk, we thought it’ll be great to have a few webinars to help our customers make the most of them. We’re starting off with our most talked about feature, Blueprint in Zoho Desk. You can register for the Blueprint webinar here: The webinar will be delivered by our in-house product experts. This is a good opportunity to ask questions to our experts and understand how Blueprint can help you automate your service processes. We look forward to seeing


                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner





                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ










                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                            • Recent Topics

                                                                                                            • "In Zoho CRM, during the Blueprint transition to the QC stage, I want to make the 'Packing Proof' image field mandatory."

                                                                                                              @Dr Saurabh Joshi @Haiku Technical Support @Ishwarya SG @Sparrow Hill President @Hugh Marshall "In Zoho CRM, during the Blueprint transition to the QC stage, I want to make the 'Packing Proof' image field mandatory."
                                                                                                            • Can Zoho CRM Emails be used in Zoho Analytics in any capacity?

                                                                                                              We're wanting to display details about Lead Activity in regular reports through Zoho Analytics but we're having difficulty integrating Emails at all. We'd like to be able to note when an email is received and when it is sent somewhere other than just
                                                                                                            • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

                                                                                                              We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
                                                                                                            • Product Updates in Zoho Workplace applications | March 2025

                                                                                                              Hello Workplace Community, Let’s take a look at the new features and enhancements that went live across all Workplace applications this March. Zoho Mail Include original attachments in reply email When you Reply or Reply All to an email, original attachments
                                                                                                            • If Problema Formula

                                                                                                              Ceil(Datecomp(${Seguimiento de Venta.Fecha de la proxima visita},Now())/1440) Tengo porblema al plantear el If Quiero que si el valor es dega
                                                                                                            • Free Webinar Alert! Track, Bill, Get Paid: Streamline Finances with Zoho Books and Zoho Mail

                                                                                                              Hello Zoho Community! Struggling to keep track of invoices, payments, and client communication? We’ve got you covered! In this webinar, we’ll show you how Zoho Mail and Zoho Books work together to simplify invoicing, track payments, and streamline financial
                                                                                                            • Bug in Kiosk Studio: GetRecords "Fields to Display" Change does not work

                                                                                                              I made a Change in our Kiosk GetRecords "Fields to Display". The change does not appear in the actual Kiosk. Neither on preview, nor on live usage. Configuration: Actual Kiosk:
                                                                                                            • Field of Lookup Module 2 Way Dynamic Connection

                                                                                                              I have several lookup fields in my custom Module And I have added fields from lookup fields to my module In my account module, I have a field called Quarterly Revenue Forecast But this is only one way i-e the field value is only fetched during record
                                                                                                            • "In Zoho CRM, during the Blueprint transition to the image field mandatory and file upload field mandatory

                                                                                                              I want image and file upload field want to be mandatory during the blueprint transition In the QC done Transtion Iwant to make QC done file upload and Case QR Sticker Mandatory In Pre delivery Stage i want to make Site ready file upload field mandagtory
                                                                                                            • View Filter for Date field type doesn't give option for "not in the last" or "before x days"

                                                                                                              I'm trying to set up some saved filters to organize a view better and I want to have saved filters based on the amount of contact that has been had with a client. We have a custom date field that records the last exchange with the client (whether call
                                                                                                            • need a third party to fix email authentication dns records

                                                                                                              at my wit's end - zoho began giving me spf, dmarc, dkim errors two weeks ago fussed with it since and now it seems dkim is the only problem and when i added the dkim record with the key from zoho mail it still wont work tired of this, need someone who
                                                                                                            • Zoho Not Receiving Emails Sent via PHP mail() – Arrives at Gmail/Outlook, but Not Zoho

                                                                                                              I have a PHP script on my website that sends emails using the basic mail() function — not SMTP or wp_mail() from WordPress. The email sends successfully to other addresses I own (like Gmail and Outlook), but emails sent to my Zoho-hosted address are never
                                                                                                            • Custom code ass to header and footer code doesn't appear

                                                                                                              I am trying to insert custom code into both the header and footer of my Zoho site. I edit the site "general settings" as demonstrated in the various articles, click save, but the code does not appear on my site. Is there something special I need to do
                                                                                                            • Differentiating between invoice templates when adding custom fields

                                                                                                              We are adding HS codes to the items which we would like published on our international customers invoices plus other export data required. We don't need this data on our domestic customer invoices. We have setup an invoice template for them but it if
                                                                                                            • Limit POP Downloads to Inbox?

                                                                                                              Hello, When I connect to and download email from my account using the POP3 protocol, it appears that it's also downloading email from my Sent mailbox. Is there any way to limit the POP downloads to Inbox emails only? Thanks!
                                                                                                            • Market Automation is hung in sync with crm in zoho one

                                                                                                              Sync between Market automation and crm stuck in loop. MA says they are connected, but does not allow module selection, building of lists, etc. can not go back around and disconnect and restart. Does not show in "Connected Apps", yet when you ty to connect
                                                                                                            • Currency Field Does Not show commas upon entry - leading to inaccurate entries!

                                                                                                              Hello Zoho.. When our sales reps are entering deals and the profit/revenue it is difficult to accurately enter numbers with lots of zeros when there commas are NOT added until the record is saved. Could commas be added to this filed type as it is being
                                                                                                            • Kaizen #116 - Client Types in Zoho API Console

                                                                                                              Hello everyone! Welcome back to another post in the Kaizen series! This week, we will discuss different client types available in Zoho API Console, and when to use each. When you register an app in Zoho API Console, you typically choose a client type
                                                                                                            • Used Car Inventory Tracker

                                                                                                              I need a to create an inventory database that has detailed information about each car we have in our inventory. Specifically, I need to know exactly how much labor and parts we have into each car as well as the cars purchase price, VIN, color, year, source etc. Budget : Negotiable | Duration : 1 week To leave a private message, please click the link for private response in post Action section.
                                                                                                            • Create Funnel to Track Email Outreach Conversion

                                                                                                              Hello, We would like to create a funnel that measures: N° of emails sent -> N° of emails opened -> N° of emails responded We would like to measure this email response conversion rate for each of our SDRs. We use the analytics tool of Zoho CRM and not
                                                                                                            • Zoho CRM - Analytics: How Can I Set Monday as First Day of The Week?

                                                                                                              Hello, In the analytics section of our Zoho CRM (not Zoho Analytics), we would like to track our SDRs' outreach activity. However, it appears that Zoho CRM treats Sunday as the first day of the week for the "This Week" and "Previous Week" filters. How
                                                                                                            • Flow-Level Access Permissions in Zoho Flow

                                                                                                              Hi Zoho Flow Team, Hope you're doing well. We would like to request a feature enhancement for Zoho Flow related to user-level access control. Use Case: As Zoho One users, we often work with multiple teams and departments. In our setup, we have several
                                                                                                            • Tip of the week 63- Know your contacts well with polls in Zoho Campaigns

                                                                                                              Communication in its true form is characterised by feedback. In email campaigns there are a few avenues via which you can achieve this. Using polls in Zoho Campaigns is one such way. With polls enabled in campaigns, your contacts can interact with your emails and help you understand them well.     There are three types of polls available to be enabled in your email campaigns:   Basic poll Rating based poll Reaction based poll     Basic poll-    Provide a question and allow the email recipients to
                                                                                                            • Subform data to Sheets

                                                                                                              I have been trying to setup a Zoho Flow automation to bring any Subform input to a Zoho Sheets but it seems impossible to post the subform entries to a Zoho Sheet. Is there any way to do it via Zoho Sheet API? https://www.zoho.com/sheet/help/api/v2/#CONTENT-Insert-row-with-JSON-data
                                                                                                            • The Invoice Status in Zoho Finance is misleading

                                                                                                              We have many overdue invoices, but when we try to filter it by Status Overdue in the Zoho Finance Module it shows it as none This is also creating a problem when I need to Create a Chart or KPI for overdue Invoices If I open the Invoice I can see the
                                                                                                            • Error AS101 when adding new email alias

                                                                                                              Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
                                                                                                            • Filter by technical IDs that should not be displayed

                                                                                                              Hello Zoho and Cumminity. I know I have already found similar requests elsewhere, but have not yet received a solution from Zoho. Therefore I would like to refresh the topic and hope that a solution can be found. I have reports in the Creator, which I
                                                                                                            • Problem Pasting Into Notes

                                                                                                              Occasionally I want to create a note by copying and pasting a few paragraphs from an article on line. When I create a new note and paste in the section the newly created note winds up with each paragraph in white text on a dark background rather than
                                                                                                            • Bank transaction automation

                                                                                                              I would like to automatically update the "Reference#" field with whatever text is in the "Description" field each time Zoho Books pulls my bank feeds. I've figured out the automation all the way up to the Field Update, where "Reference Number = ...???"
                                                                                                            • Payment Gateways For South Africa

                                                                                                              Hi, Can you please incorporate a payment gateway like Payfast etc for South African clients?
                                                                                                            • Zoho Error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details

                                                                                                              Hello There, l tried to verify my domain (florindagoreti.com.br) and its shows this error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details. Screenshot Given Below -  please check what went wrong. Thanks
                                                                                                            • Sales IQ - Bot Builder - Forward to Operator Action Card Improvement

                                                                                                              Hi team, It would be a great improvement to have an additional branch out of the Forward to Operator Action Card. I would like to allow 10 seconds for an operator to pick up the chat, if they don't or if they reject the chat I would like the Bot to continue
                                                                                                            • Email template for customer notification on ticket reply is not being used

                                                                                                              I've set up an email template for notify contact up upon receiving a reply in ticket. When I send a reply to the ticket, it is not using that email template. It just sends a normal looking email. How do I make it so that the email template is being used?
                                                                                                            • Global Fields

                                                                                                              Just like Global Sets for Picklists, we would like to have global fields for any kind of field. Three things that should be saved globally: 1. The Existence of the field 2. The Name and 3. Association with a module should be set up in a respective place
                                                                                                            • how do i see a list of active End Users?

                                                                                                              looking for a list of who i sent invitations to be an End User?  who has signed up? 
                                                                                                            • Modular cannot Edit in portals

                                                                                                              I have a custom module in CRM. If I create in either CRM or portals, I can edit it in the CRM but I can't edit in the portal. Even if it is created in the portal it wont edit. Anyone know why? I've created a new module and it works fine but this one
                                                                                                            • How Can I change admin account Email?

                                                                                                              Hi, I want to change admin email address for my account (I'm using Zoho Mail). How can i do this? Thanks!
                                                                                                            • Zoho Desk - Feature Request - Add more social channels on Community user profile

                                                                                                              Hi Team, While updating my profile here I noticed that it is only possible to add Facebook and Twitter social links. 1. Please consider adding at least LinkedIn and if possible, other popular channels. 2. Please consider renaming Twitter field name to
                                                                                                            • Hide Admin Only settings

                                                                                                              It would be nice if the setup menu items and settings weren't visible to non-admins. Seems like there is some confusion with users going through setup pages but not having permissions and getting an invalid permission error.
                                                                                                            • Lookups from Standard Modules to Custom Modules

                                                                                                              I have created an "External Contacts" Custom Module for adding Contacts who aren't directly associated with a Customer or Vendor but who are related to Orders by being a Site Contact, Job Contact, Warehouse Contact, etc for third party. How can I go about
                                                                                                            • Next Page