Get all Tasks(Tasks,SubTasks, Sub-SubTasks) together

How to get all tasks(Tasks,SubTasks, Sub-SubTasks) in a single result by using Asana API or asana.js.

Last time I checked it was not possible, and it is very annoying indeedā€¦ @Matt_Bramlage can you confirm please?

Thanks for your reply,
Still its not possible, Please check and let us know.

@Avi and @Bastien_Siebman, it actually is possible, but I have to lead off with a ā€œwe discourage itā€ for a pretty good reason - itā€™s possible to cause an Asana API stability issue with this. It makes for a somewhat dangerous situation, especially if youā€™re building an integration for many users, because the amount of data that comes back depends on the structure of the subtasks. Your integration might be fine, then bam, a pathological case that causes us to ban your app for that user :frowning:

Iā€™ve started some dialogues with the API team about whether we can mitigate this to some degree, but in the future, the mitigation will probably look quite different than what we allow at present - it will probably be either something meant to traverse nested graphs like http://graphql.org/ or we just remove the method by which you can do this today, or both, so how to do it right now is likely to change in the future.

That being said, it can be pretty handy if you absolutely know that youā€™ll never ask for a pathological subtask tree, so rather than go through how it can be done here (in case others stumble on this without reading the caveats above ^ ) Iā€™ll DM you with how to do it.

Cheers!

2 Likes

I would also like to know how to get all subtasks of a task under a particular Project using the API. Iā€™m trying to set something up for this using Klipfolio and I donā€™t want to have to go and create multiple datasources one for each task with a particular ID.

Hello, Iā€™ve just come across this post from a couple months ago and was wondering what your ā€˜how to do itā€™ was. Iā€™ll Iā€™m doing is getting all tasks and subtasks to analyze in a BI platform, and retrieving all tasks and subtasks right now for our 181 projects is a little cumbersome. Weā€™re only authenticating as one user and no other users are going through our app, so youā€™re issues you brought up donā€™t apply to us.

Thanks

@Matt_Bramlage what would be nice is the ability to know if there are sub tasks under a task? (e.g. a has_subtasks true/false) then we can know if we need to take the initial expense if syncing themā€¦ Then after the initial sync we are using webhooks (or trying to), however that opens up the other side of the issue for us, how do know what project(s) that sub task is under. Which If found out today is far more complicated that it should be IMHOā€¦ As a sub task can have projects assigned directly to it, and the parent, parent,ā€¦ task can have different projects assigned to it.

3 Likes

Is this still not an option?

I need this for a Klipfolio integration.

Hi @Tony_Monita,

Yes, unfortunately this is still not available. Our API team has been chatting about what sorts of possibility there is to find a middle road here where we donā€™t have a feature thatā€™s all but guaranteed to get your app shut down for particular users, but still provides enough context to allow you to know when you might need to make more requests.

A basic version of this might be something like @Edward_Rudd suggested and have some signal that there even are any subtasks to be fetched, which means you donā€™t have to make a second request for every task on the off chance that it might have subtasks. We might be able to do even a bit more and give you the count of subtasks or an array of IDs, but weā€™re not sure just yet what this is going to look like. Weā€™re working on it though!

1 Like

It looks like there is still no way to determine if a task has subtasks, short of calling tasks/TASKID/subtasks on every single task. When will a subtask count or something similar be implemented in a taskā€™s properties?

For people stumbling on here: It is now possible to get a list of subtasks:

I feel like this problem still hasnā€™t been resolved for business tier companies, as only enterprise has access to organization export and to a findAll API method for tasks. This makes tasks with no projects invisible for API fetching.

Could you give me any pointers as to how to solve that problem, @Matt_Bramlage ?

Can you point to where in the documentation youā€™re seeing this? Iā€™m not familiar with any enterprise-specific findAll API method.

I checked the Java API library Iā€™m using and it is attempting to request ā€˜/tasksā€™ GET with no parameters.
Sorry for introducing that confusion.

The closest thing I would name would be the search tasks in workspace method.

1 Like