The GUI provides a nice way to make copy of a task with subtasks and associated tasks.
From what I gather, the API route is a bit convoluted.
- Get original task’s information
- Create new task based on that information
- Get subtasks of original task and push them to the new task
- Get new task’s ID, subtask IDs and match on subtask’s name to add sub sub tasks
If you are matching on name and if the task name changes, your matching won’t work.
You would not know the ID of the new subtask to attach the sub sub task to until you you added the parent subtask. Then you would need get the subtasks of the new task to add the sub sub task to but again, unless you knew the ID, you would be matching on name of task.
P.S. I’d love to see a /tasks/:id/copy endpoint.