Power of Automation:: Automate the process of creating checklist upon task creation.

Power of Automation:: Automate the process of creating checklist upon task creation.

Hello Everyone,

A Custom Function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as to when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it.

Requirement:-

One of our customers wanted to add a specific checklist from the checklist template upon Task creation. This was successfully implemented using Task custom function in Zoho Projects. Please refer this link to know more about checklist extension. 
 
Custom function code:-
 

// extension > settings > url id = app_id
// scopes: ZohoProjects.entity_properties.ALL and ZohoProjects.extension_properties.ALL
endPoint = "https://projects.zoho.com/restapi/portal/";

checklistName = "checklist name";
// replace with your checklist name
appId = "YYYYY";
// replace with your app id
getAllChecklist = invokeurl
[
url :endPoint + portalId + "/extensions/properties/retrieve?app_id=" + appId + "&property_key=templatesTitle"
type :GET
connection:"XXXXX"
];
values = getAllChecklist.get("properties").get(0).get("value").toCollection();
for each value in values
{
if(value.get("value").containsIgnoreCase(checklistName))
{
templateId = value.get("template_id");
}
}
getParticularChecklist = invokeurl
[
url :endPoint + portalId + "/extensions/properties/retrieve?app_id=" + appId + "&property_key=" + templateId
type :GET
connection:"XXXXX"
];
values = getParticularChecklist.get("properties").get(0).get("value").toCollection();
childObject = Map();
childObject.put("ListID",templateId);
childObject.put("value",checklistName);
childObject.put("view","fullView");
childObject.put("templateId",templateId);
childArray = List();
childArray.add(childObject);
object = Map();
object.put("Checklist_Titles_Store",childArray);
object.put("count",1);
parentArray = List();
parentArray.add(object);
param = Map();
param.put("app_id",appId);
param.put("entity_id",taskId);
param.put("entity_type","1");
param.put("project_id",projectId);
param.put("property",parentArray);
storeInEntity = invokeurl
[
url :endPoint + portalId + "/entity/properties/store"
type :POST
parameters:param
connection:"XXXXX"
];
param.clear();
childArray.clear();
for each value in values
{
childObject = Map();
childObject.put("completed","false");
childObject.put("who","");
childObject.put("time","");
childObject.put("id",value.get("id"));
childObject.put("title",templateId);
childObject.put("value",value.get("value"));
childArray.add(childObject);
}
object.clear();
object.put("Checklist_Items_Store",childArray);
parentArray.clear();
parentArray.add(object);
param.put("app_id",appId);
param.put("entity_id",taskId);
param.put("entity_type","1");
param.put("project_id",projectId);
param.put("property",parentArray);
storeInEntity = invokeurl
[
url :endPoint + portalId + "/entity/properties/store"
type :POST
parameters:param
connection:"XXXXX"
];
return "success";

 
 
Ensure that XXXXX  in the above code is replaced with the Zoho OAuth connection link name, including the scope ZohoProjects.entity_properties.ALL and ZohoProjects.extension_properties.ALL. Refer to this link for guidance on creating the connection.
 
Additionally, replace YYYYY with the checklist app ID and checklist name in line 4. A sample screenshot is attached for reference on fetching the app ID.
 
Please find the screenshots of the parameters to be mapped and sample Task workflow rules.

We hope you found this post useful. If you have any questions, feel free to share them in the comments below.


    • Sticky Posts

    • Time Log Reminder

      Tracking the time spent on tasks and issues is one of the most important functions of a timesheet. However, users may forget to update the time logs because they have their own goals to achieve. But, time logs must be updated at regular intervals to keep
    • Introducing the Zoho Projects Learning Space

      Every product has its learning curve, and sometimes having a guided path makes the learning experience smoother. With that goal, we introduce a dedicated learning space for Zoho Projects, a platform where you can explore lessons, learn at your own pace,
    • 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-update Phase Status

      Hello Folks! You can auto-update your phase's status based on status of underlying tasks using custom functions. In this series, we will showcase how to create and run custom functions, using Deluge, with ease. Follow the steps below and automate your
    • Automate Timesheet Approvals with Multi-level Approval Rules

      Introducing Approval Rules for Timesheets in Zoho Projects. With this automation, teams can manage how timesheets are reviewed and approved by setting up rules with criteria and assigning approvers to handle submissions. Timesheet, when associated to