Hi, I’ve made some code in PHP so I can create a new project based on an existing template (since it’s not supported by the API yet). However, it takes about 10 minutes to create everything from scratch with 396 requests!! It’s a little bit too long since there could be more than 1 project to create at the same time and we can,t wait 1 hour until it’s created.
Here are the operations that I do in order:
- Create a new project
- Add the Custom Fields definition to this project (custom fields already exist in other projects so I just link them)
- For each tasks of the template
3.1) Get the task name and create a new task
3.2) Add this newly created task to my project
3.3) Get the template task information (custom fields)
3.4) Get the template task dependencies
3.5) Update the newly created task with the information (custom fields, see 3.3)
3.6) For each subtasks of the template
3.6.1) Get the template subtask information (due date and name)
3.6.2) Create the subtask to my newly created task in my project with the information
3.6.3) Get the template subtask dependencies
- Now, my project is created with every task and subtask and all custom_fields are filled. I need to add the dependencies so I loop in an array that bind the template tasks and the new project tasks and then I add the dependency.
As you see, every step is an API request so it gets pretty slow since my template is pretty big. Is there any step that I could optimize (mix requests together) or a better way to do this?