Is there any way to fetch all tasks by team gid?

Hi,

I am trying to get all the tasks by team, but there seems to be no way to fetch them directly. Is there any other option to do this, or is it possible in the future to add team as a parameter for this endpoint?

https://developers.asana.com/reference/gettasks

Hi @jays_123 and welcome to the forum,

No, there’s not a way to accomplish this via the Asana API. You’ll need to get a list of the projects in that team, then loop through each project and get its tasks. (Keep in mind you may end up with some tasks more than once since a task can be multi-homed into more than one project.)

I don’t work for Asana so can’t say for sure, but I would not expect to see a team-wide task endpoint in the future as I know Asana pays a lot of attention to API scalability, and retrieving all of the tasks in a team could mean the API having to send tens or hundreds of thousands of tasks, for a large team.

You can get them directly by using the Search API.

https://developers.asana.com/reference/searchtasksforworkspace

and the “teams.any” parameter.

But, paging doesn’t work like other endpoint of you query more than 100 tasks.

1 Like

Good point, @Frederic_Malenfant, I forgot about the search endpoint.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.