Automation Series: Move Tasks to a different Task List on Status Change

Automation Series: Move Tasks to a different Task List on Status Change

In Zoho Projects, you can automatically move a task from one task list to another when its status is updated. This keeps your tasks organised and ensures better visibility while reducing manual work.

For instance, during a product launch, the marketing team often organize the tasks into task lists such as "Commitments", "Delivered", and "On hold", etc to keep the workflow organized. Tasks such as Competitor Analysis and Audience Research are initially added to Commitments list with status set as Open.

When a task is completed and signed off, its status is updated to Delivered.

By executing a custom function, this status change automatically moves the task to the Delivered task list. This keeps the Commitments list focused on active work, while the Delivered list maintains the record of completed work.

This can be implemented by executing a Custom Function and associating it with a Workflow Rule.

To configure this flow,
  1.  Navigate to the upper-right corner of the page and click   → Developer Space → Connections.
  2. Create a new connection with the scope ZohoProjects.tasks.UPDATE.


      3. Navigate to Custom Functions and under the Task tab, create a new custom function and add the following Deluge script.
Notes
Ensure that the portal URL aligns with your data centre. If not, the function may not execute as expected.
  1. if(taskListName.equalsIgnoreCase("Commitments"))
  2. {
  3. endPoint = "https://projects.zoho.in/restapi/portal/";
  4. toTasklistId = 389289000000177375;
  5. // Replace the tasklist id of "Delivered Tasks" above
  6. moveTaskParameter = Map();
  7. moveTaskParameter.put("from_todolist",fromTasklistId);
  8. moveTaskParameter.put("to_todolist",toTasklistId);
  9. moveTaskResponse = invokeurl
  10. [
  11. url :endPoint + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/move"
  12. type :POST
  13. parameters:moveTaskParameter
  14. connection:"projects"
  15. ];
  16. info moveTaskParameter;
  17. info moveTaskResponse;
  18. }
  19. return "success";
Info
Line 1: Replace "Commitments" with the task list that holds your active tasks.

Line 3: Update the toTasklistId with the ID of the task list where completed tasks should land.

Line 12: Replace "projects" with your connection name.
      4. Add the arguments mentioned below.



      5. Click Save and Execute.
      6. Enter the Task ID when prompted.

Once the custom function is saved and executed without issues, you will have to associate it with a workflow rule.

      7. Navigate to  in the upper right corner of the page.
      8. Click on Automation → Workflow Rules → Projects Tab.
      9. Click New Workflow Rule.
      10. Configure the workflow to trigger Based on User Action and when a task is Updated.
      11. Set the criteria as Task Status Is Delivered.


      12. Click +Add Action and select Associate Custom Function.
      13. Click Save Rule.


If the task status is updated in a task list and if the criteria matches with the rule, the task will be moved to another task list automatically.
If you have any questions, feel free to drop a comment below or reach out to us at support@zohoprojects.com.