You have to remember that by default (unless someone explicitly adds it), a subtask is not attached to the project of its parent. So “# of tasks in a project” will not include most subtasks since they’re not technically in the project.
thanks for the quick reply!
yes I’m aware that they are not directly part of the project, though with the search API Asana is able to return all subtasks, so I was hoping for
either an API call on a project / workspace level that returns ALL tasks
either an API call that returns the same number as you find in the admin console, returning tasks under your owned workspaces / organisations (see screenshot)
@Willem_Dewulf I am surprised this number (538) includes subtasks!
Because in the API, a subtask is not member of a project until it is specifically assigned to it.
They never “inherits” from the parent project, as they can be member of another project, or no project (by default).
And, you are right, the api call to get number of tasks by project does not includes subtasks, except if you set a project on all of these subtasks manually. But, I don’t suggest to do that, because they will now appear directly on your lists when you query the project in API or Asana UI !
I did a check 2 day ago by adding 1 task and 1 subtask and the total in the admin dashboard did increase from 538 to 540 so I do think that number has all tasks.
But so as far as you know, there is no API call on an account level to see how many tasks are under your premium organizations (as to reflect the same number you see in the admin console)?
Hi @Willem_Dewulf,
It’s interesting to hear that the admin console counts subtasks too!
I needed to update task description of all tasks in a project before, and I looped through tasks to get their subtasks.
I assume that method is all what we have for counting subtasks through API.
It’s not ideal because the for loop of GET requests was really slow, it sometimes takes an hour.