Hello Everyone,
Here we are again, filled with excitement to share yet another requirement that has been accomplished through the implementation of custom functions.
In general, a custom function is a user-written set of code to achieve a specific requirement.
Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it.
Requirement:-
One of our customers had a specific requirement to automatically clone the Task and move the cloned Task to a Tasklist in another project on specific status update.
For example, when Task A's status is updated to 'Approved' within Project A, Task A should be automatically duplicated and moved to a Tasklist in Project B.
Custom function code:
// TODO : Clone Task from one project to another project.
// Copy Task
copyTaskParamMap = Map();
copyTaskParamMap.put("no_of_instances","1");
copyTaskDetails = invokeurl
[
url :projectsV3APIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/copy"
type :POST
parameters:copyTaskParamMap
connection:"'xxxxxxxxx'"
];
info copyTaskDetails;
info "-------------------------------------";
// Move Task
moveTaskParamMap = Map();
moveTaskParamMap.put("from_todolist",tasklistId);
// TaskList ID in which the task is to be moved
moveTaskParamMap.put("to_todolist","1683929000004182021");
moveTaskDetails = invokeurl
[
url :projectsRestAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/move"
type :POST
parameters:moveTaskParamMap
connection:"'xxxxxxxxx'"
];
info moveTaskDetails;
info "-------------------------------------";
return "success";
Replace 'xxxxxxxxx' in the above code with the connection name and the destination tasklist Id (1683929000004182021) to which Task to be moved. Screenshot of the list of parameters to be mapped is attached for reference.
Our customer was able to capitalize on custom functions in Zoho Projects which allowed them to automate the process of cloning Tasks, reducing time consumption and in turn increasing their business productivity.
We hope you found this post useful. If you have any questions or wondering if your requirement could be met using custom functions, feel free to share them in the comments section below.