Power of automation :: Automatically Update Sub Task Owner in Zoho Projects Using Custom Functions

Power of automation :: Automatically Update Sub Task Owner in Zoho Projects Using Custom Functions

Custom Function helps in populating the task fields automatically. If you have multiple default and custom fields in the tasks and it will be tough to enter the values manually. Also, this will be time consuming to update the values for multiple tasks across projects. We can avoid this manual process using the custom function.


Use Case ::


Let’s take the below scenario where one customer would like to auto update the owner of the sub tasks same as task owner. For example, David is the owner of the parent task then David should be owner for all the sub tasks under this task.


We have successfully accomplished this requirement via custom Functions. Here is the code.


// TODO: Please create a connection for the Zoho Projects service with the scopes "ZohoProjects.tasks.READ,  ZohoProjects.projects.READ, ZohoProjects.tasks.UPDATE". Replace 'xxxxxxxxx' with the connection name. Click this link below to learn how to create the connection.


task = invokeurl

[

url :APIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/"

type :Get

connection:”********”

];

isparent = task.get("tasks").get(0).get("isparent");

parentid = task.get("tasks").get(0).get("parent_task_id");

if(isparent != null)

{

parenttask = invokeurl

[

url :APIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/" + parentid + "/"

type :Get

connection:”*********”

];

m = "";

owners = parenttask.get("tasks").get(0).get("details").get("owners");

for each  owner in owners

{

id = owner.get("id");

m = m + id + ",";

}

param = Map();

param.put("person_responsible",m);

info param;

subtasksdetails = invokeurl

[

url :APIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/" + parentid + "/subtasks/"

type :GET

connection:”********

];

subtasks = subtasksdetails.getJSON("tasks");

for each subtask in subtasks

    {

     subtaskId = subtask.get("id");

 subtaskPost = invokeurl

[

url :APIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/" + subtaskId + "/"

type :Post

parameters:param

connection:”**********”

];

}

}

return "success";


Conclusion ::


By using custom functions in Zoho Projects, you can automate the task updates and save your time and effort. This custom function is just one example of how you can use custom functions. With a little bit of creativity, you can create custom functions that suit your specific project needs.


Watch this space for more custom function codes.



      • Sticky Posts

      • Auto-update the Successor Task Status.

        Hello folks! We have come up with a new use case for custom function to help you automate the workflow of your tasks. Users can write their own Custom Functions using deluge and call them from a workflow. Consider a scenario where the status of the successor
      • Collaborate Visually with Whiteboard in Zoho Projects

        Whiteboard in Zoho Projects allows you to collaborate visually by creating diagrams, annotating designs, and sketching project workflows using shapes, text, and images within project modules. Team members can work simultaneously, improving productivity
      • Introducing Projects 8.0 - Focusing on Ease-of-Use and New Features

        Hello everyone! It's time for the reveal of the 8th version of Zoho Projects! This year our focus has been on minimizing the learning curve and improving the ease-of-use of the tool, so anyone new to Projects can hit the ground running and existing users
      • Manage Documents with SharePoint Extension in Zoho Projects

        SharePoint is a digital platform to store and manage your documents. Multiple users can work on the same document simultaneously, which enhances your team's productivity. By installing the extension in Zoho Projects, users can access the documents seamlessly
      • Work agile in Zoho Projects! The much-awaited Zoho Sprints integration is in the making.

        Let your teams work in both classic and agile methodology using our integration with Zoho Sprints. We made sure you get the best of both worlds with this integration. You can scale through teams irrespective of what methodology they use and make sure they work with speed and flexibility. And, you can do it all from one place- Zoho Projects.  Why this integration is a benefit?  This integration mostly helps in managing classic and agile practices together. Most organizations use a mix of both classic