Power of Automation :: Unique Task & Issue Prefix Format and Sequencing Rule

Power of Automation :: Unique Task & Issue Prefix Format and Sequencing Rule

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 use case ::

Each project should have its own unique TASK and Issue prefix ID. Every new project must include a sequential number in the prefix—for example, the first project would use ZOHO-PR1, the second ZOHO-PR2 and so on.

This functionality can be implemented using Custom Functions. First, establish a connection with the Zoho Projects service using the scopes 'ZohoProjects.Projects.ALL'.

Make sure to set the connection link name to ‘connectionprojects’ in the code provided below. The screenshot of Arguments is attached for reference.
projectsAPIEndPoint = "https://projectsapi.zoho.com/restapi";
params = Map();
params.put("sort_column","created_time");
params.put("sort_order","descending");
getAllProjects = invokeurl
[
url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/"
type :GET
parameters:params
connection:"connectionprojects"
];
previousProjectPrefix = getAllProjects.get("projects").get(1).get("taskbug_prefix");
if(previousProjectPrefix.contains(prefix))
{
if(previousProjectPrefix.length() == prefix.length())
{
newPrefix = prefix + "1";
}
if(previousProjectPrefix.length() > prefix.length())
{
iterator = previousProjectPrefix.subString(prefix.length()).toLong() + 1;
newPrefix = prefix + iterator;
}
}
else
{
newPrefix = prefix + "1";
}
params = Map();
params.put("taskbugprefix",newPrefix);
updateProject = invokeurl
[
url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/"
type :POST
parameters:params
connection:"connectionprojects"
];
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.

    Access your files securely from anywhere


          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

                                                                • Update on V2 API End-of-Life Timeline

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

                                                                  As task progresses, several users are required to stay aware of the updates to plan their upcoming work items efficiently. Manually adding users as followers for an active task might create additional overhead. With this automation, followers can be added
                                                                • WhatsApp Business Integration for Zoho Projects

                                                                  Delivery channel plays a decisive role in how quickly certain project updates translate into immediate actions. A release is ready to go live. An issue is marked critical. An approval is pending. These moments are less about tracking and more about timely
                                                                • Enhanced Collaboration and Global Web Tabs

                                                                  Hello Users, We are rolling out two key enhancements in Zoho Projects that will be part of our November release. Here’s what to expect: 1. Collaboration Section in the Left Navigation Panel What’s new? All communication and interactive tools will be grouped
                                                                • Choosing the Right Automation in Zoho Projects

                                                                  In any project, different types of actions are needed at different points. Some projects require control on how tasks move, some require reacting to updates, and some require executing additional actions beyond the task. Automation in Zoho Projects is


                                                                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

                                                                                                  Get Started. Write Away!

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

                                                                                                    Zoho CRM コンテンツ





                                                                                                      Nederlandse Hulpbronnen


                                                                                                          ご検討中の方