I wanted to share a custom function that can greatly enhance collaboration and notification processes in complex projects. In scenarios where multiple teams are working on a single work item and the completion of a parent task is a prerequisite for subsequent tasks, it becomes crucial to keep everyone involved updated once the parent task is closed. This is where the custom function comes into play.
The function I'm about to introduce enables the automatic sending of email notifications to the owners of sub-tasks when the parent task transitions to the "Closed" status. This ensures that relevant team members are promptly informed, allowing them to proceed with their tasks in a timely manner.
Here's the code for the custom function along with the arguments passed.(Refer the attachment for arguments)
if(taskstatus == "Closed")
{
values_map = Map();
values_map.put("index",1);
values_map.put("range",200);
info values_map;
taskdetails = invokeurl
[
type :GET
parameters:values_map
connection:"zoho_projects"
];
subtasks = taskdetails.getJSON("tasks");
userIds = List:String();
emailusers = List:String();
emailIds = "";
for each subtask in subtasks
{
emailId = subtask.getJSON("details").getJSON("owners").getJSON("email");
emailIds = emailIds + "," + emailId;
}
emailIds = emailIds.subString(1,emailIds.length());
sendmail
[
from :zoho.loginuserid
to :emailIds
subject :"Test"
message :"<div>Test ignore<br></div>"
]
info emailIds;
}
return "success";
By utilizing this custom function, project teams can eliminate manual notifications and ensure seamless communication across various work items. Team members will receive automated email notifications as soon as the parent task is closed, empowering them to progress with their respective sub-tasks promptly.
I hope this custom function proves useful in streamlining collaboration and keeping everyone informed in your complex projects. Feel free to give it a try and let me know if you have any questions or further suggestions.
Watch this space for more such custom function codes.