Power of Automation :: Add a comment automatically once the task status is updated

Power of Automation :: Add a comment automatically once the task status is updated

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. 


Let's take the below use case from a customer


Whenever the status of a task is updated, it should be automatically added as a comment in that task.

 

This can be accomplished using the below code. Create a connection using the scope “ZohoProjects.tasks.CREATE” and update the connection name 'connectionprojects' in the below code. Please find the attached screenshot of the Arguments & workflow rule.

Here is the link to know how to create a connection.

endPoint = "https://projects.zoho.com/restapi/portal/";

commentsParam = Map();

commentsParam.put("content","Task status is updated to " + status + " by " + actionPerformer);

taskCommentDetails = invokeurl

[

url :endPoint + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/comments/"

type :POST

parameters:commentsParam

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.