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


#1

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


#2

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


#3

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


#4

@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!


#5

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.


#6

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


#7

@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.


#8

Is this still not an option?

I need this for a Klipfolio integration.


#9

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!