I’m trying to recreate the data from "My Tasks"within our integration (for scheduling and tracking time against the tasks) so users can find their tasks more easily under sections.
The only way I’ve been able to achieve this is:
GET users/me/user_task_listto get the My Task ID (which is the project ID).
GET projects/:id/sectionsto get the sections from My Tasks.
GET sections/:id/tasksto get the tasks within each section.
That works, but it requires pulling all tasks and of course multiple requests. We can store the
user_task_list ID, but the sections and tasks within the sections would have to be pulled every time.
My test workspace has a handful of sections and ~1,000 tasks. In the third step I’m pooling the
tasks requests to send them concurrently, but in my testing thus far, this entire process can still take anywhere from 6-19 seconds from first request to final response.
Ideally, I’d just take the
user_task_list ID and send a single request to
projects/:id/tasks with a
limit and be able to paginate through the tasks as needed. This will return the tasks in the correct order and the initial response is significantly faster with a single request with a size limit, but I can’t seem to get the sections this way.
In the response from Asana,
memberships does not include the My Tasks project and sections, just “real” projects and sections the task is associated with.
Is there another way to go about this that I haven’t found or is there a plan to include the My Tasks membership info with the response in the future? Ideally for this situation, when the user makes a request to
projects/:id/tasks with the
id being their own My Tasks project ID, then the My Tasks membership info would be included.
The Asana app appears to be doing just this, as it is lazy loading tasks and sections in My Tasks. I’d like to approach this the same way!