Power of Automation :: Implementing Deadline-Based Task Scoring with Custom Fields

Power of Automation :: Implementing Deadline-Based Task Scoring with 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. 


Requirement:- 


Implement a task scoring system based on task completion dates.

A custom field named ‘Scoring’ has been created within the Tasks module and it will be used to store the calculated score.

The following explains the logic:

If a task is completed on or before its due date, it should be assigned a score of 100.

For every 3-day delay beyond the due date, 30 points should be deducted from the score.

Here is an example for better understanding.

3 days late → Score: 70

6 days late → Score: 40

9 days late → Score: 10

10+ days late → Score: 0 (minimum score threshold if needed)

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

Here is the code ::
endPoint = "https://projectsapi.zoho.com/restapi/portal/";
updateTaskParameter = Map();
if(completedDate != null && dueDate != null)
{
delayFieldName = "Score";
daysDiff = daysBetween(toDate(toString(dueDate,format)),toDate(toString(completedDate,format)));
if(daysDiff <= 0)
{
score = 100;
}
if(daysDiff > 0 && daysDiff <= 3)
{
score = 70;
}
if(daysDiff > 3 && daysDiff <= 6)
{
score = 40;
}
if(daysDiff > 6 && daysDiff <= 9)
{
score = 10;
}
if(daysDiff > 9)
{
score = 0;
}
// Get task layout details
taskLayoutDetailsResponse = invokeurl
[
url :endPoint + portalId + "/projects/" + projectId + "/tasklayouts"
type :GET
connection:"connectionprojects"
];
sectionDetails = taskLayoutDetailsResponse.get("section_details");
for each  section in sectionDetails
{
customFieldDetails = section.get("customfield_details");
for each  customFieldDetail in customFieldDetails
{
if(customFieldDetail.get("display_name").containsIgnoreCase(delayFieldName))
{
delayFieldId = customFieldDetail.get("column_name");
break;
}
}
}
updateTaskParameter.put("custom_fields",{delayFieldId:score});
updateTaskResponse = zoho.projects.update(portalId,projectId,"tasks",taskId,updateTaskParameter,"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. 

    • 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:

    Nederlandse Hulpbronnen


      • Recent Topics

      • Zoho Hilfe in NRW für Kundenprojekt gesucht!

        Hallo, wir sind auf der Suche für ein Kundenprojekt, wer die Implementierung von Zoho übernehmen kann. Unsere Stärke liegt im Onlinemarketing, bzw. der Automatisierung mit Klick-Tipp und den Tools drum herum. In dem Projekt können wir dem Kunden mit dem jetzigen CRM nicht weiter helfen, bzw. ihn nicht auf die nächste Stufe bringen. Leider komme ich mit meiner Suche in Foren, SocialMedia und sonst wo nicht weiter.  Der Idealfall ist ein gemeinsamer Besuch vor Ort beim Kunden und hier eine Präsentation
      • Gaps in Core HR Functionalities in Zoho People

        Hello People team, We've been using Zoho People for quite some time now and truly appreciate its flexibility and customizability. That said, I wanted to share some feedback based on our experience implementing core HR processes within the platform. Several
      • Product and Service

        Hi guys, there is a difference between layout of product and service if Long Description field have some kind of text. Please see screenshot 1 for Service here: https://prnt.sc/7xWwPKd29nWP for Product here: https://prnt.sc/LGmtVd_U6H7q As you can see
      • Anyone Building AI-Based SEO Dashboards in Zoho Analytics?

        Hey everyone, I’m currently working on an SEO reporting dashboard in Zoho Analytics and looking to enhance it with AI-based insights—especially around AI visibility, keyword trends, and traffic sources. The goal is to track not just traditional metrics
      • Phone Number Integration

        I would like to be able to track my cell phone calls in the CRM.  So if a contact calls my cell phone number, a note of that phone call will be made in the CRM so that I don't have to remember to go back in and add the call manually. Is there a way to connect the CRM and my cell phone via a 3rd party? Such as Google Voice, Skype, etc. Its important that my clients don't have to call a new or different number and that sent calls use the same number as well. So if there is a way to connect my phone
      • Woocommerce Line Item Information

        I'd like to add each line item from a Woocommerce order to a zoho creator form record. The line items are found within the line items array, but I'm not sure how to get each item out of the array? Any help would be much appreciated.
      • 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
      • 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
      • Important notice: Migration is needed from the legacy ASAP to the latest ASAP Zoho Desk flow

        We recommend upgrading to the latest version, as the older version will eventually be discontinued and will no longer receive any further enhancements or bug fixes. We are announcing an important update concerning the ASAP help widget in Zoho Desk. The
      • NFC Support

        Hi, I would like NFC Support like Zoho Creator, to pre-fill field values by scanning an RFID device. Zoho Creator NFC here: https://www.youtube.com/watch?v=F4JoMWnF82I Both on a Field's User Input (Mobile Apps), in additon to QR Code & Barcode today,
      • Live webinar: Building brand consistency using Zoho Show

        Getting people to remember your brand isn’t easy. And if your branding isn’t consistent, it becomes almost impossible. One place where consistency really matters? Presentations. Whether it’s a sales pitch, an event deck, or a team update, your slides
      • Getting an error "Not able to connect server. Verify your network connection" during proforma invoice converting to invoice.

        Getting an error "Not able to connect server. Verify your network connection" during proforma invoice converting to invoice. 
      • calendar I created in Zoho Creator not being imported to Google calendar any longer

        A calendar that I created in my Zoho Creator app is no longer updating (or showing up at all) in my google calendar. It used to export appointments I set up in my app to google calendar. I cannot figure out how to correct this.
      • Quoting Subscriptions with one Time costs

        Hello all, We sell a subscription SaaS service for which we provide one-time services for implementation and customization. Using CRM quotes i was able to create customized total fields to show the total one-time costs, monthly cost, total subscription
      • Automatisez efficacement avec le nouveau concepteur de workflows flexibles

        Auparavant, l'automatisation dans les modèles de fusion de Writer se limitait à des actions simples comme « fusionner et stocker », « fusionner et envoyer par e-mail » ou « fusionner et envoyer pour signature ». En revanche, il était jusqu’à présent impossible
      • More context, fewer tabs: View lookup modules' data within a CRM Canvas page

        Hello everyone, How often do your users juggle multiple browser tabs just to piece together the full context of a record? This update can make their lives easier. You can now add lookup modules' fields to a Canvas detail view page and a Canvas list view
      • On click of the Blueprint transition (Qualified or Not Qualified), the 'Convert' option should be enabled in the Lead module.

        On click of the Blueprint transition (Qualified or Not Qualified), the 'Convert' option should be enabled in the Lead module. console.clear(); let convertButton = ZDK.Page.getButton('convert'); let leadStatus = ZDK.Page.getField('Lead_Stage').getValue();
      • Show all items making up the composite item in transactions

        Dear Zoho, Currently, when we select a composite item in Zoho Inventory for a transaction, we do not receive a breakdown of the individual items that make up the composite. This makes it challenging for our team to accurately pick, pack, and ship the
      • Custom Roles & Granular Permission Control in Zoho SalesIQ

        Hello Zoho SalesIQ Team, We appreciate the functionalities offered by Zoho SalesIQ, but we would like to request a crucial enhancement regarding user roles and permissions. Current Issue: At present, Zoho SalesIQ provides fixed roles—Admin, Supervisor,
      • Condition to skip recipient signature

        Is there a way, alone or with a Zoho Form integration, to skip a recipient signature when a condition is set? This happens because in this template, not always all the recipients need to sign it. Sometimes its just a few. We are using a Zoho Form integration
      • How to filter emails by Reply-to field?

        I receive a very particular newsletter from an association A registered on a website W (that is used by many associations), and the emails fields are not great: the From just contains the generic website's W's email, while A is only mentioned in the Reply-to
      • Wich version of Backstage is included in Zoho One

        Hello I am in the event business and i am considering Zoho One to replace my current tools. I will need Backstage to manage my events but I am wondering wich version of backstage will I get if I subscribe to Zoho One. Thank you Guillaume
      • How to restore deleted campaigns?

        I accidentally deleted my first campaign that went out today (08/21/18). How do I restore it?
      • 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:
      • Kits: Option to Hide Associate Items on Documents

        The new Kit type of Composite Item is very helpful, and we're already using it in several different ways. One problem is that there seems to be no way to hide the components on some documents, including Package Slips. There is an option given in settings
      • Zoho Books CREDIT LIMIT is completely USELESS due to a BUG!!! Please fix it ASAP!!

        Credit Limit should not be taken into account if payment terms on the Invoice are without credit. If selected Credit 0 days (Prepayment) why in this world would a notification pop up saying credit limit is exceeded and not allowing to create an invoice?
      • Is it possible to adjust the web browser tab title (when a ZoHo Desk ticket is opened)

        Hi All, When I open a ZoHo Desk ticket in a web browser, the tab title (text that appears at the top of the browser tab) uses the logic: *company icon picture* (xxxx) #ticket number - company name See below (highlighted in red) for reference. Company
      • Configure ChatGPT in Zoho Cliq | Now with GPT-4!

        Updated for GPT-4 Support: The post and scripts has been revised to take advantage of the new GPT-4 model's capabilities. Please use the updated version for enhanced performance and accuracy. If you have been on the internet for the past few months, you
      • Have completed Zoho Sign documents attach automatically to contact and/or account

        Hello, Just used ZohoSign for the first time to get an e-signature on an important document. Setting up the template was nice and easy and configuring the request to go to the right people and training a member of staff was also very easy. HOWEVER Why
      • Using email "importance" as workflow-criteria

        I'd like to set up a workflow that triggers if an incoming email has been flagged as "high importance" but I'm not seeing any way to do that. Hopefully I'm just missing something obvious...?
      • Update Lead Status in Zoho CRM When a Meeting is Booked via Microsoft Bookings

        Hi everyone, I’m trying to streamline our lead management process and would like to automatically update the Lead Status in Zoho CRM whenever a meeting is booked through Microsoft Bookings. Has anyone successfully implemented this kind of integration
      • Kaizen #199: FAQs on Multi-Select Lookup (MxN) Field in Zoho CRM

        Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone. Got
      • Zoho Desk Android app update: Enhanced UI of the History tab.

        Hello everyone! In the latest Android version(v2.9.10) of the Zoho Desk mobile app, we enhanced the UI of the 'History' tab within a ticket. Also, we have introduced a filter option to easily search the history based on the actions performed on the ticket.
      • Is Zoho Marketing Plus part of Zoho One?

        Hi, Is the new fancy Zoho Marketing Plus part of the Zoho One package? Is there any benefit in using this rather than the standalone products? Many thanks Jon
      • Is it possible to Bulk Update 'Product Name' in Zoho Desk?

        Is it possible to Bulk Update 'Product Name' in Zoho Desk? I cannot see that option now. Kindly help how we can do it.
      • Change visable Subform fields

        I have a form with 4 subforms in it. I added another field to each of the subforms in my main form. Now, how do I update the subforms to show the new fields that I added?
      • 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?
      • Trial Extenstion/ 2nd Go!

        Hi, Recently trialed FSM bit didnt get a chance to try out the most recent features is it possible to get another trial to try the new features and see if I can make it work for me?
      • Weekly Tips : Take Control of Your Sent Emails using Outbox Delay

        Ever clicked “Send” on an email, then instantly realized you forgot something—like a file, an attachment, or even made a small typo? It happens more often than you'd think. Wouldn’t it be helpful if your email waited a little before actually going out?
      • Format of data after export to spreadsheet

        Dear Zoho, can you explain to me what is the point of a report exporting to XLSX if the format of the amounts that will be created there is in text format and not suitable for anything? Why do I need data in a sheet with which nothing more can be do
      • Next Page