Update Task API Limit Issue

Update Task API Limit Issue

I am running into issues with the API limit for update task in Zoho Projects. 

In a typical Project, we have 120-130 Tasks and I would like a field change made to the Project to propagate down to all Tasks that belong to the Project. (In this case "Territory). I am running the below function upon field change of Project.Territory to update Task.Territory.

Is there any reasonable way to get around the 100x API usage limit for this function?

  1. // Get all tasks for the specified project ID
  2. taskDetails = zoho.projects.getRecords(portalId,projectId,"tasks",0,0,"xxxxxxxxxx");
  3. tasksList = taskDetails.get("tasks");
  4. // Create a map to specify the custom field update
  5. customFieldsMap = Map();
  6. customFieldsMap.put("UDF_CHAR82",territory);
  7. // Create the main map and nest the custom fields map within "custom_fields"
  8. updateTaskParameter = Map();
  9. updateTaskParameter.put("custom_fields",customFieldsMap);
  10. //only run code if Project.Territory is not null
  11. if(territory != null)
  12. {
  13. // Loop through each task in taskDetails (Tasks belonging to projectId)
  14. for each  task in tasksList
  15. {
  16. // Access the ID of each task and Territory (UDF_CHAR82) 
  17. taskId = task.get("id");
  18. taskTerr = task.get("UDF_CHAR82");
  19. //Check if Task has subtasks
  20. taskisParent = task.get("isparent");
  21. // If Task has Subtasks get all Subtasks belonging to this Task
  22. if(taskisParent == TRUE)
  23. {
  24. subTaskResponse = invokeurl
  25. [
  26. url :projectsAPIEndPoint + "/portal/" + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/subtasks/"
  27. type :GET
  28. connection:"xxxxxxxxxx"
  29. ];
  30. //For each Subtask belonging to this task update Territory if not already matching
  31. for each  subTask in subTaskResponse.get("tasks")
  32. {
  33. // Access the ID of each task and Territory (UDF_CHAR82) 
  34. subtaskId = subTask.get("id");
  35. subtaskTerr = subTask.get("UDF_CHAR82");
  36. if(subtaskTerr.toString() != territory.toString())
  37. {
  38. subtaskUpdate = zoho.projects.update(portalId,projectId,"Tasks",subtaskId,updateTaskParameter,"xxxxxxxxxx");
  39. }
  40. }
  41. }
  42. // Perform the update operation if Task.Territory differs from Project.Territory
  43. if(taskTerr.toString() != territory.toString())
  44. {
  45. taskUpdate = zoho.projects.update(portalId,projectId,"Tasks",taskId,updateTaskParameter,"xxxxxxxxxx");
  46. }
  47. }
  48. }
  49. return taskUpdate;


    Access your files securely from anywhere

        All-in-one knowledge management and training platform for your employees and customers.







                              Zoho Developer Community




                                                    • Desk Community Learning Series


                                                    • Digest


                                                    • Functions


                                                    • Meetups


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner


                                                    • Word of the Day


                                                    • Ask the Experts





                                                              Manage your brands on social media



                                                                    Zoho TeamInbox Resources



                                                                        Zoho CRM Plus Resources

                                                                          Zoho Books Resources


                                                                            Zoho Subscriptions Resources

                                                                              Zoho Projects Resources


                                                                                Zoho Sprints Resources


                                                                                  Qntrl Resources


                                                                                    Zoho Creator Resources



                                                                                        Zoho CRM Resources

                                                                                        • CRM Community Learning Series

                                                                                          CRM Community Learning Series


                                                                                        • Kaizen

                                                                                          Kaizen

                                                                                        • Functions

                                                                                          Functions

                                                                                        • Meetups

                                                                                          Meetups

                                                                                        • Kbase

                                                                                          Kbase

                                                                                        • Resources

                                                                                          Resources

                                                                                        • Digest

                                                                                          Digest

                                                                                        • CRM Marketplace

                                                                                          CRM Marketplace

                                                                                        • MVP Corner

                                                                                          MVP Corner









                                                                                            Design. Discuss. Deliver.

                                                                                            Create visually engaging stories with Zoho Show.

                                                                                            Get Started Now


                                                                                              Zoho Show Resources

                                                                                                Zoho Writer

                                                                                                Get Started. Write Away!

                                                                                                Writer is a powerful online word processor, designed for collaborative work.

                                                                                                  Zoho CRM コンテンツ




                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方