Bug: filtering sections in advanced searches not working

Hello,

I’m using the advanced search https://app.asana.com/api/1.0/workspaces/{workspace_gid}/tasks/search
The filter “sections.any” is showing tasks that don’t belong to the section I’m indicating.
My query looks like workspaces/{workspace_gid}/tasks/search?sections.any={section_gid}&sort_by=created_at&sort_ascending=true&opt_fields=custom_fields,created_at&completed=false&projects.any={project_gid}
And I’m getting tasks gid which, if I look them with the get task query, have sections different than the one I’m requesting…
All those tests are also performed directly through the API tester in the documentation.

Is it a known bug or am I doing something wrong? :slight_smile:

Thanks,
Xavier.

2 Likes

Hi @Xavier_Marot, thank you for the report!
I’m checking it internally.

2 Likes

That is weird. My recommendation would be double check the GID’s for the workspace, you can use the following to see all of your workspaces.

Also, confirm that you actual want to being searching for a workspace. I’ve heard things about workspace vs organization. And maybe you don’t actually want to look for a workspace rather a team/organization.

I may be misinterpreting your message but also, remember that sections fall within projects. And projects are generally accessible by members of a workspace. So personally when looking at all the sections in my project I used this GET request.

That way you can use the GID of your section to get other information. But it seems like you want all tasks in a project since you’re using Section.Any. So really you can use the following,

https://app.asana.com/api/1.0/tasks?project={ProjectID}

This will return all the tasks within the specified project, and you can apply your filters as follows

GET https://app.asana.com/api/1.0/tasks?project=ProjectID&opt_fields=custom_fields,completed,created_at

I find the below resource helpful for formatting the filters for my requests and in general.

Hopefully this was helpful.

Hi Jeremy,

Many thanks for your input :slight_smile:
My goal was to retrieve tasks on multiple projects that belonged to the same workspace.
At the time I posted the issue, I got in touch with Asana’s dev team and I was able to produce clear data that show there was a bug.
Hopefully they managed to fix it.

Best,
Xavier.