Power of Automation :: Dynamically generate Tasklists based on values selected in Task Custom Fields

Power of Automation :: Dynamically generate Tasklists based on values selected in Task Custom Fields

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. 


Lets take the below use case from a customer - 


A custom field named ‘Category’ has been created within the Tasks module. This field contains values that correspond directly to the names of the task templates available in the portal.

In every project, there is a predefined task called ‘Development’. Depending on the value selected in the ‘Category’ field of this Development task, a tasklist should be automatically generated. This tasklist will be created by applying the task template that matches the value specified in the custom ‘Category’ field.

This automation ensures that the appropriate task template is used to create the tasklist without requiring manual selection, streamlining project setup and maintaining consistency across all projects.

This can be accomplished using the features Custom Functions & Workflow Rules. Create a connection using the scopes “ZohoProjects.tasklists.ALL, ZohoProjects.tasks.ALL" and update the connection name ‘projects’ in the below code. Find the attached screenshot of the Arguments & Workflow.

Below is the code
if(tasklist_picklist == null)
{
	return "No value selected";
}
else
{
	info tasklist_picklist;
	tasklists = tasklist_picklist.toList();
}
endpoint = "https://projectsapi.zoho.com/";
getAllTasklists = invokeurl
[
url :endpoint + "api/v3/portal/" + portalId + "/projects/" + projectId +
 "/tasklists"
type :GET
connection:"projects"
];
// info "getAllTasklists : "+getAllTasklists;
for each  tasklist in getAllTasklists.get("tasklists")
{
	tasklistName = tasklist.get("name");
	if(tasklists.contains(tasklistName))
	{
		tasklists.remove(tasklists.indexOf(tasklistName));
		info tasklistName + " removed";
	}
}
info " tasklists : " + tasklists;
taskTemplateResponse = invokeurl
[
	url :endpoint + "api/v3/portal/" + portalId + "/templates/tasklists"
	type :GET
	connection:"projects"
];
if(taskTemplateResponse.containKey("task_list_templates"))
{
	templates = taskTemplateResponse.get("task_list_templates");
	templateMap = Map();
	for each  template in templates
	{
info "Template Name : " + template.get("name") + "-------- >  Id : 
"+ template.get("id");
	if(tasklists.contains(template.get("name")))
	{
		templateMap.put(template.get("name"),template.get("id"));
	}
	}
}
info templateMap;
for each  template in templateMap
{
// info template;
taskTemplateId = template;
associateTaskTemplateParameter = Map();
associateTaskTemplateParameter.put("task_template_id",taskTemplateId);
associateTaskTemplateParameter.put("shift_days",toString
(zoho.currenttime,"YYYY-MM-dd'T'HH:mm:ss") + "Z");
associateTaskTemplateResponse = invokeurl
[
url :endpoint + "restapi/portal/" + portalId + "/projects/" + projectId +
 "/tasklists/"
type :POST
parameters:associateTaskTemplateParameter
connection:"projects"
];
	info associateTaskTemplateResponse;
}
return "success";


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

 

Watch this space for more such custom function codes. 


      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Schedule Exports for Regular Project Updates

            Tracking project data often means exporting data at regular intervals. Instead of manually exporting data every time, users can schedule exports for Phases, Tasks, and Tasks in Zoho Projects. These exports can be set to run once, daily, weekly, or monthly
          • Set Custom Business Calendars and Holidays for Global Teams

            Managing a project across diverse teams means accounting for more than just tasks and deadlines; it means acknowledging how and when each team actually works. Users might follow different working days or observe region-specific holidays that cannot be
          • Introducing Version-3 APIs - Explore New APIs & Enhancements

            Happy to announce the release of Version 3 (V3) APIs with an easy to use interface, new APIs, and more examples to help you understand and access the APIs better. V3 APIs can be accessed through our new link, where you can explore our complete documentation,
          • Restore Trashed Records Anytime Within 30 Days

            Access the recycle bin from the Data Administration tab under the settings page in Zoho Projects, which gives better control over the trashed data. When records like projects, phases, task lists, tasks, issues, or project templates are trashed, they are
          • Organize and Clone Task Custom Views

            We have rolled out two new enhancements to task custom views: Custom View Groups and Custom View Clone. Custom View Groups Similar to predefined view groups, we have introduced groups for custom views to help organize and categorize them. My Custom Views:

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ






                                ご検討中の方

                                  • Recent Topics

                                  • Collaps Notes

                                    There are times when long/large notes are added to a record i.e. Accounts or Deals etc. Currently, the full note is displayed in the notes related list section. It would be great if by default only 5 to 10 rows of the note are displayed when the note
                                  • Zoho Down

                                    I have a drop in my Zoho One services.
                                  • Runing RPA Agents on Headless Windows 11 Machines

                                    Has anyone tried this? Anything to be aware of regarding screen resolution?
                                  • Problem for EU users connecting Zoho CRM through Google Ads for Enhanced conversions

                                    Has anyone else experienced this problem when trying to connect Zoho CRM through Google Ads interface to setup enhanced conversions? Did you guys get it fixed somehow? The Problem: The current Google Ads integration is hardcoded to use Zoho's US authentication
                                  • Why am I getting event Pop-up Notification for events that have been cancelled?

                                    Why is Calendar Notification still popping up for events that have been cancelled or changed? Each time events are cancelled or changed, I have observed that I am still getting notifications for them. Below is a sample pop-up notification for one of the
                                  • Rich Text For Notes in Zoho CRM

                                    Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
                                  • Whatsapp Limitation Questions

                                    Good day, I would like to find out about the functionality or possibility of all the below points within the Zoho/WhatsApp integration. Will WhatsApp buttons ever be possible in the future? Will WhatsApp Re-directs to different users be possible based
                                  • Create a draft in reply to an email via Emails API

                                    Hi, I’d like to use the outgoing webhook to automatically create a draft reply to incoming mail. How can I use the Emails API to create a draft reply that is linked to an existing email thread? I couldn’t find the relevant method in the documentation.
                                  • India Tech Support

                                    Is there no phone tech support number for India? And no chat facility either?
                                  • Billing Management: #1 Billing an Universal Business Routine

                                    Hello, As the saying goes, "Do the hardest job first", we started with the complex subject in finance, revenue management, which is considered to be the backbone for any business. Now, let's shift our focus and take a deep dive into this Billing Management
                                  • Show/ hide specific field based on user

                                    Can someone please help me with a client script to achieve the following? I've already tried a couple of different scripts I've found on here (updating to match my details etc...) but none of them seem to work. No errors flagged in the codes, it just
                                  • What is a a valid JavaScript Domain URI when creating a client-based application using the Zoho API console?

                                    No idea what this is. Can't see what it is explained anywhere.
                                  • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ (9/25)

                                    ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 9月開催のZoho ワークアウトについてお知らせします。 今回はZoomにて、オンライン開催します。 ▷▷参加登録はこちら:https://us02web.zoom.us/meeting/register/6OSF2Bh6TumsMIlDwaY_PQ ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho
                                  • Zoho Calendar not syncing correctly with personal Google Calendar

                                    Coming to this forum as Zoho Calendar support team is not responding, any more. For the past 8 weeks, I have been having an issue with Zoho Calendar not syncing with my personal Google Calendar correctly. I subscribed to Zoho Calendar iCal in my personal
                                  • Introducing Assemblies and Kits in Zoho Inventory

                                    Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
                                  • Customer Parent Account or Sub-Customer Account

                                    Some of clients as they have 50 to 300 branches, they required separate account statement with outlet name and number; which means we have to open new account for each branch individually. However, the main issue is that, when they make a payment, they
                                  • need a packing list feature

                                    In our business, goods listed on an invoice are packed in separate boxes and shipped off. for e.g. an invoice may have 10 items. each item could then be packed in different boxes depending on qty of each item. this packing list is as important as the invoice for purposes of shipping documents.  Request you to add this feature asap.
                                  • Prevent stripping of custom CSS when creating an email template?

                                    Anyone have a workaround for this? Zoho really needs to hire new designers - templates are terrible. A custom template has been created, but every time we try to use it, it strips out all the CSS from the head.  IE, we'll define the styles right in the <head> (simple example below) and everything gets stripped (initially, it saves fine, but when you browse away and come back to the template, all the custom css is removed). <style type="text/css"> .footerContent a{display:block !important;} </style>
                                  • Workdrive 5.0 / API Documentation Workflows

                                    Hi Zoho, When will the API documentation of the workflows be published? We are interested in using it to trigger manual workflows from an external application. Greetings, Justin
                                  • How to keep track of bags, cans, drums of inventory?

                                    We buy and sell products that are packaged in bags 🛍️, cans🥫, drums🛢️, etc. with batch numbers. When we get a shipment of one of the products, how do we track we received (say) 10 cans each of 5L of a product and maybe we received 10 cans of another
                                  • 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
                                  • How many ZOHO-Sites does the ZOHO-One Suite allow for?

                                    The free version of ZOHO-Sites allows for two sites, but it seems that the professional version (which is included in the ZOHO-One Suite) only allows for two websites. Is that correct? How many sites can I have within one ZOHO-One account?
                                  • Replace Lookup fields ID value with their actual name and adding inormation from subforms

                                    Hi everyone,  I wanted to see if someone smarter than me has managed to find any solutions to two problems we have. I will explain both below.  To start we are syncing data from Zoho CRM to Zoho Analytics and I will use the Sales Order module when giving
                                  • Having Trouble Opening The Candidate Portal

                                    Recently am having trouble opening the Candidate Portal. It keeps loading but cannot display any widgets. Tried Safari, Chrome and Edge. Non of them work. Please solve the problem ASAP.
                                  • Webhook from Zobot to Zoho Flow fails

                                    I'm trying to connect from zobot to zoho flow. When testing in zflow, I am receiving all entered data from the connector correctly. The SalesIQ connector's "outputreaction" is {} (is this normal or is there a problem?). But as soon as I try my chat bot
                                  • Transition from Sole Proprietorship to GmbH (Limited Liability Company) – Best Approach in Zoho Books / Zoho One

                                    Hello everyone, I am currently operating under a Zoho One plan with a sole proprietorship in Switzerland. As of January 1st, 2026, I will be incorporating a new legal entity – a GmbH (Swiss equivalent of a Limited Liability Company). While the business
                                  • Presenting ABM for Zoho CRM: Expand and retain your customers with precision

                                    Picture this scenario: You're a growing SaaS company ready to launch a powerful business suite, and are looking to gain traction and momentum. But as a business with a tight budget, you know acquiring new customers is slow, expensive, and often delivers
                                  • Best way to display complex Bookings Consultation Descriptions on Zoho Site?

                                    I am a new user so apologies if this has been asked before. I couldn't find any answers in the forum. We offer 18 complex Consultations to our subscribers. Our current platform lets me put detail on these Consultations thoroughly (200-300 words) during
                                  • DKIM cannot be enabled for the domain as no verified default selector present

                                    Hi Support Team, For Domain DKIM record trying to enable status. but showing error "DKIM cannot be enabled for the domain as no verified default selector present" So, please resolve the issue. Thank you.
                                  • Issue Connecting My Domain to Zoho Sites Despite Purchasing It from Zoho

                                    Hello, I am facing an issue connecting my domain to my website on Zoho Sites. Details of the issue: I purchased the domain directly from Zoho. I am already using the same domain successfully with Zoho Mail. However, when I try to assign this domain to
                                  • Insert auto number from main form into subform rows

                                    Hello. I'm trying to take from my main form "order number" which i have setup as an auto generated number into every line created in my subform. So when a row is created in my subform i want the "order number " from the main form to be inserted automatically.
                                  • Dark Mode - Font Colors Don't Work

                                    When editing a document in Dark Mode and selecting font colors, they don't show up on screen.  Viewing/editing the same document in Light Mode shows them just fine.
                                  • Integrate Bunq with ZOHO Bookes

                                    We are new users of ZOHO Books, and our bank (BUNQ, in the Netherlands) isn't listed on the bank integrations. Is there a way to handle this?
                                  • Cliq iOS can't see shared screen

                                    Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                  • Access Denied

                                    I am iOS Developer and updating our clients project and shifted ZohoDeskPortalCore SDKs from cocoapods to SPM and changed few lines of code but now i am get access denied, the help center app is unavailable. please contact administrator.
                                  • Using Zoho Desk to support ISMS process

                                    Hi, I am evaluating using Zoho Desk for security incident management. This seems to be aligned with Zoho Desk purpose as its just another type of incident. However in security incident management, ideally I can link incidents (tickets) with a risk from
                                  • Bin Locations

                                    Dear all, I am wondering if someone has the ability to develop the bin locations option for zoho inventory (integrated with zoho books) Regards, Ryan
                                  • TaxJar vs Avalara

                                    Hi, I'm evaluating adoption of a sales-tax service for US based business. Anyone else have experience with TaxJar and Zoho Books? I am a Zoho One subscriber so anticipate needing to use Flow to make this work. It seems like Avalara are simply too expensive
                                  • How to check Leads with no Task (open activity)

                                    Hi everyone, I was wondering if there’s a way to view leads that don’t have any tasks assigned or open activities linked to them.
                                  • What can we do on our end to improve the Answer bot answers?

                                    Hi, I'm using the Answer bot card in the Codeless bot builder. I've input several questions and their answers in the FAQ section to feed the Answer bot. The text is all in French, as this is the language our customers communicate in. I've tried testing
                                  • Next Page