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. 

    Access your files securely from anywhere







                        Zoho Developer Community





                                              Use cases

                                              Make the most of Zoho Desk with the use cases.

                                               
                                                

                                              eBooks

                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                               
                                                

                                              Videos

                                              Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                               
                                                

                                              Webinar

                                              Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                               
                                                
                                              • Desk Community Learning Series


                                              • Meetups


                                              • Ask the Experts


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner


                                                        • Sticky Posts

                                                        • Sandbox - Your Secure Testing Space in Zoho Projects

                                                          Managing projects often involves fine-tuning processes, setting up new automations, or making configuration changes. Making changes directly in a live environment can disrupt production as it does not leave room for trial and error. Sandbox in Zoho Projects
                                                        • One Place for All Your Automation Needs

                                                          All automation settings are grouped under Settings ()> Automation. This helps you find everything related to automation from one place. Under Workflow Rules, Email Alerts, Email Templates, and Webhooks: Use the Projects tab for project-specific settings.
                                                        • 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,
                                                        • Zoho Projects - Quarterly Updates | Q1 2025

                                                          Hello Users, We would like to share the latest updates for this quarter. Here is a round-up of the features and enhancements we rolled out in Q1: Working with Zoho Projects data in Power BI? Integrate Zoho Projects to Power BI and sync module data (from
                                                        • Analyze Project Trends with Power BI Integration for Zoho Projects

                                                          Integrate Microsoft Power BI with Zoho Projects to sync project data, create reports, and analyze trends. This integration allows you to track key project metrics and share insights with your stakeholders. Managing multiple projects requires clear visibility


                                                        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

                                                                                                        • MULTI-SELECT LOOKUP - MAIL TEMPLATE

                                                                                                          Dear all how are you? We need to insert data from MULTI-SELECT LOOKUP in a email template, but I can't do that, when I'm creating the template I can't find the field to insert it. is there any solution? PVU
                                                                                                        • Create Encrypted Zoho Forms URL for SMS Pre-Population forms using zfcrm_entity=

                                                                                                          Hello Zoho Forms Community and Zoho Team, I’m trying to send a Zoho Forms URL via SMS with pre-populated CRM contact data, inspired by a post from four years ago by GlennP (https://help.zoho.com/portal/en/community/topic/passing-the-crm). Our form is
                                                                                                        • Tracking Emails sent through Outlook

                                                                                                          All of our sales team have their Outlook 365 accounts setup with IMAP integration. We're trying to track their email activity that occurs outside the CRM. I can see the email exchanges between the sales people and the clients in the contact module. But
                                                                                                        • on submit of creator form then record is create in Zoho crm purchase module then on automatically task want to create in the crm

                                                                                                          on submit of creator form then record is create in Zoho crm purchase module then on automatically task want to create in the crm
                                                                                                        • Zoho Forms - edit the settings of the Zoho CRM field to change the integration with CRM

                                                                                                          I've created a Zoho CRM field in my form to pre-populate selected CRM details into the form, following the instructions here https://help.zoho.com/portal/en/kb/crm/integrations/zoho/zoho-forms/articles/zoho-forms-crm-integration#Step_2_-_Add_Zoho_CRM_Field_in_the_form
                                                                                                        • Data Integration Platform

                                                                                                          Hi,  Is anyone aware about a data integration platform like Dell Boomi that can work with Zoho Support? Any help will be higghly appreciated.  Thanks Kunal
                                                                                                        • Zoho CRM Webinar – Automate everything across Customer Journeys in CommandCenter 2.0

                                                                                                          How efficient is your current CRM automation setup? As customer journeys become more dynamic, it's common for data and actions to get scattered across teams and modules. This leads to broken processes and inconsistent customer experiences—especially across
                                                                                                        • Ability to add notes to an appointment and add notes/attach docs to a consultation

                                                                                                          As an idea for the future, it would be helpful to be able to add notes to an existing appointment--there is a place to add notes for the customer, but I don't see one for the appointment. It would also be helpful to be able to add notes or attach documents
                                                                                                        • Time Entry : Auto fill fields Hours minutes seconds

                                                                                                          Hello world, Do someone know a script (for workflow rules) which fill automatically fields hours spent, minutes spent, seconds spent when we fill Executed time and End time Formula should start from (End time - Executed time) Thx in advance
                                                                                                        • How to query Deal "Stage" "Is Open" in Analytics SQL?

                                                                                                          How do I query this "field" in Analytics? What is going on? It seems like there is another 'mapping' somewhere but that it is inaccessible with raw sql??? If I query "Stage" Like '%Won%' I get a wildly different number than I do when I manually filter
                                                                                                        • Im trying to white list domain dynamically in zoho desk extension

                                                                                                          Im trying to white list domain dynamically in zoho desk extension. But it show error Error: {errMsg: 'No entry found in plugin-manifest whiteListedDomains for requested URL'} syntax "config": [ { "displayName":"Shopify Admin API access token ", "name":
                                                                                                        • Backorder For Composite Items

                                                                                                          Hello If i released SO for composite item and use backorder feature of zoho inventory then it should backorder child item items of composite and not composite item.This is basic of backordering.I conveyed this to zoho call center but no solution yet.
                                                                                                        • Passing the CRM

                                                                                                          Hi, I am hoping someone can help. I have a zoho form that has a CRM lookup field. I was hoping to send this to my publicly to clients via a text message and the form then attaches the signed form back to the custom module. This work absolutely fine when
                                                                                                        • Zoho Payroll: Product Updates for India - May 2025

                                                                                                          This May, we are glad to unveil new capabilities in Zoho Payroll that simplify your payroll activities. Here's the list: Let Employees Choose Their Tax Deduction Method for One-Time Payments Calculate variable earnings based on percentage of CTC Carry
                                                                                                        • Enhance Zoho One Conditional Assignment to Fully Reassign App Settings When Changing Departments

                                                                                                          Hi Zoho Team, We’d like to submit a feature request regarding the current behavior of Zoho One’s conditional assignment logic when moving a user between departments. 🔧 Current Limitation As it stands, Zoho One’s conditional assignment does not remove
                                                                                                        • Sync failed: Invalid Date value

                                                                                                          Hi, I have a local .sqlite database. After importing one table through the Databridge, and produced my dashboards, I cannot sync. I get an error regarding the date column: [Line: 2 Field: 4] (2018-07-12) -ERROR: Invalid Date value The data found at the
                                                                                                        • Office 365 is marking us as "bulk"

                                                                                                          All of a sudden (like a couple of days ago) all of our customers who are on Office 365 are getting our mails in their junk email. This is not the case with Gmail or other random mail servers, nor between us. We got a 10/10 score on mail-tester.com. Also,
                                                                                                        • Zoho Assist

                                                                                                          Hi, We are using zoho assist unattended access in some windows server 2012 and recently the agent lets you connect but not let you do anything on the remote machine. Sometimes you can click on something but nothing happens. There's a issue with this new
                                                                                                        • Experience effortless record management in CRM For Everyone with the all-new Grid View!

                                                                                                          Hello Everyone, Hope you are well! As part of our ongoing series of feature announcements for Zoho CRM For Everyone, we’re excited to bring you another type of module view : Grid View. In addition to Kanban view, List view, Canvas view, Chart view and
                                                                                                        • Modify workflow from "ON CREATE & EDIT" to "ON CREATE" only

                                                                                                          Salut, Is there a way to easilly change my choice of trigger of workflow from on create & edit to on create only, or do I have to re-do the whole worklow from scratch ? Sylvain
                                                                                                        • Access custom modules via API?

                                                                                                          Is it possible to access a custom module in Zoho Inventory via the API? I can not find any reference to this in the API docs.
                                                                                                        • Welcome to the Zoho Service Plus community

                                                                                                          Hey everyone, We are excited to welcome you to be a part of the Zoho Service Plus community. Here's a quick overview of what Service Plus is all about and how the community can help us work together. What's Zoho Service Plus? Zoho Service Plus is a unified
                                                                                                        • Extensions 101 webinar series: Build, integrate, and monetize with extensions

                                                                                                          Attention developers! Are you ready to take your extension development skills to the next level? We're excited to bring back the Extensions 101 webinar series with an expanded lineup of Zoho products and an introduction to more platform features. Last
                                                                                                        • Restrict Zoho Cliq Webinars and Announcements to Admins Only

                                                                                                          Hi Zoho Team, We hope you're doing well. We would like to raise a feature request regarding in-app announcements in Zoho Cliq, such as the recent webinar popup about the Cliq Developer Platform: While these announcements are useful, they are not always
                                                                                                        • Track ZohoForm Conversion using Postmessage event

                                                                                                          Hi, I’ve been using a third-party lead tracking tool to capture leads from my website along with their source. Earlier, with the HubSpot form, the third-party script was able to detect the postMessage event that iframe forms typically send back to the
                                                                                                        • Related Lists filter

                                                                                                          I have Contacts showing in our Accounts module. I customized the Contacts module with an Employment Status field, with the following picklist options: "Primary Contact", "Secondary Contact", "Active Staff(not a main contact)", and "No longer employed".
                                                                                                        • Share Notebook with group created in Zoho One

                                                                                                          I have created a group in Zoho One for a section in my company. Is it possible to share a notebook with that Zoho One Group? Currently, it seems only possible to share to emails. Unfortunately for large teams, this will mean we are constantly having to
                                                                                                        • Create Tasks in arbitrary Zoho Project triggered from CRM [Zoho Flow]

                                                                                                          Community, hello What I'm trying to do is to create a Zoho Project when a Deal is created in CRM and then to be able to add tasks to this Project also from Zoho CRM with the trigger (Blueprint/ Workflow). I succeeded in creating Project using Zoho Flow,
                                                                                                        • Zoho Sheet - Desktop App or Offline

                                                                                                          Since Zoho Docs is now available as a desktop app and offline, when is a realistic ETA for Sheet to have the same functionality?I am surprised this was not laucned at the same time as Docs.
                                                                                                        • not able to access Zoho from home WIFI

                                                                                                          for some reasone i am not able to access Zoho on my laptop or my iphone while i am connected to my home Wifi, i am able to access these sites both on laptop as well as Iphone and associated apps on any other Wifi as well as when I am on my 4G connection
                                                                                                        • Multi-Select lookup field has reached its maximum??

                                                                                                          Hi there, I want to create a multi-select lookup field in a module but I can't select the model I want the relationship to be with from the list. From the help page on this I see that you can only create a max of 2 relationships per module? Is that true?
                                                                                                        • Outlook Add-in security times out needs to login 10 times a day

                                                                                                          hi we've just switched the Zoho. We use Azure SSO. All users have stopped using it. Sometimes it asks every 5 minutes. What should I lot at to solve this?
                                                                                                        • Simplify Zoho API integration with Deluge’s invokeAPI task

                                                                                                          Hello all! Happy New Year! As we kick off 2025, we’re excited to share some of the latest updates to enhance your Deluge experience. While Deluge already offered robust API integration capabilities, we’ve taken it to the next level with the introduction
                                                                                                        • Simplify Zoho API integration with Deluge’s invokeAPI task

                                                                                                          Hello all! Happy New Year! As we kick off 2025, we’re excited to share some of the latest updates to enhance your Deluge experience. While Deluge already offered robust API integration capabilities, we’ve taken it to the next level with the introduction
                                                                                                        • Attention: Display Issues on Chromium Browsers with Intel® Core™ Ultra Processors

                                                                                                          Dear Customers, We've recently identified a display-related issue that may affect some of our Zoho Assist users, particularly technicians using devices powered by Intel® Core™ Ultra Processors. What’s Happening? If you're running a Chromium-based browser
                                                                                                        • [WEBINAR] Smooth year-end closure with Zoho Books (KENYA)

                                                                                                          Hello there, This webinar is for all Kenyan businesses looking to wrap up their financial year smoothly! Join our free session to learn how Zoho Books can simplify your year-end process. What to expect from this webinar: - All the latest updates in Zoho
                                                                                                        • Is the "schedule 10 mass emails/module" limit a per user or per organization limit?

                                                                                                          For scheduling emails out of Zoho CRM, there is a 10 scheduled mass emails per module limit according to Zoho documentation (https://help.zoho.com/portal/en/kb/crm/faqs/emails/articles/how-to-schedule-mass-emails-in-zoho-crm). Is this limit per user or
                                                                                                        • How do I show file uploads in my Zoho Creator approval workflow?

                                                                                                          As far as I can tell I'm not able to add the file upload field to the approval workflow show fields list. As a work around I'm making a plain text field that links to the files URL. But I'm not sure how to get a link to that url that will me to preview
                                                                                                        • Kaizen #194 : Trigger Client Script via Custom buttons

                                                                                                          Hello everyone! Welcome back to another interesting and useful Kaizen post. We know that Client Scripts can be triggered with Canvas buttons and we discussed this with a use case in Kaizen#180. Today, let us discuss how to trigger Client Script when a
                                                                                                        • Zoho Payroll US?

                                                                                                          Good morning, just reaching out today to see if there's any timeline, or if there's progress being made to bring Zoho Payroll out to be available to all states within the USA. Currently we're going through testing with zoho, and are having issues when
                                                                                                        • Next Page