How to get the tasks in a project without also getting the sections

@Joe_Trollo @Jeff_Schneider
Will this request fail, “opt_fields: ‘resource_subtype’”? My goal in using this request was to filter out sections when I pull the tasks by projects that I’m interested in.

Thanks! :slight_smile:

Hi @James_Brown2, welcome to the Asana developer community.

We’re in the process of making some significant changes to sections in the Asana web product and in the API. For the most recent and detailed updates, please read this community thread.

The tl;dr is that sections are in an active migration (sections in list projects will soon work like columns in board projects do today). Once all list projects are migrated to this new behavior, you will be able to query GET /project/<project-id>/tasks to get all of the tasks in a project. This call will not return any sections. If you did want to see the sections of a project, you can fetch them with GET /project/<project-id>/sections.

In the meantime, the resource_subtype field will still work.

@Jeff_Schneider
Thank you for the thread and info. I’ll try implementing when the migration ends.

Thanks!

I’m coming into the thread late, here (apparently after the aforementioned migration) because I want to do what the OP did not want to do: I’d like to query the API and get a list of all tasks in a given specific project and return the section that each task is assigned under.

Under the new model, how does one do that in a single request?

Hi @Shawn_Holmes,

In your request (the one discussed above), ask for the memberships field (via opt_fields=memberships). That will return you an array of the projects a task is in, and for each project, the section it’s in.

2 Likes

Thank you! that did the trick.

I ended up going with opt_fields=name,memberships.section.name to pluck it out.

Perfect!

1 Like