The `subtasks` field on tasks is being deprecated

I assume from the lack of response to my suggestion that depth limits are a non-starter.

I had some time today to try to come up with an alternate approach. Using events at first glance seemed to be a good idea, but I pretty quickly hit some snags. First, they’re not supported in @types/asana, but I can work around that with some casts to any. Second, and more importantly, changes to tasks don’t give me enough information to replicate server changes in my application. It’ll work fine if the name is changed, but the event won’t tell me if the completion state changed, or if it was reassigned.

There’s more information available in the “story” changes, but those seem to be very hard to reconcile since multiple story changes can be produced for a single task change.

The other approach I’ve thought of would be to reload the task entirely when I detect any change to it. It would probably work at the cost of extra round trips and request quota hits.

Am I barking up the wrong tree? Is there a simple solution I’m missing to keep the client-side tasks in sync with the server?

Hi @Brian_Victor,

Yes, even depth limits are insufficient here. A single task could have hundreds or thousands of subtasks so limiting queries even just to one level of subtasks can still put significant load on our systems.

We’re aware that event streams (and webhooks) lack enough information to understand what properties of an object changed (and thus what properties you need to update to stay in sync) and we’re actively working on improvements to them. We’ll be communicating more about this work sometime in the next two months. Until then, the most robust strategy to stay perfectly in sync is to listen for events (either through event streams or webhooks) and then fetch the full object that changed.

1 Like

Hi Jeff & Joe,

Wondering if I could get some advice on the best way to pull the information I need. I really need to pull the assignee of the subtask since we have projects with multiple people working on a task but no way to report / assign that other than with subtasks. As of right now would it be best to follow the points below?

Would this also be the best way to retrieve story information?

Thank you!

Hi @Jill_H, the only supported way to fetch subtasks is through the GET /tasks/task-id/subtasks endpoint. You can use our opt_fields feature to include the subtasks’ assignees in the response.

To fetch stories for a task, you’ll need to use GET /tasks/task-id/stories for each individual task.

1 Like

2 posts were split to a new topic: How to get the tasks in a project without also getting the sections