Tasks Query completed_since is broken for sections


#1

Hi there, I think the completed_since parameter for task query is broken for sections. I was only able to use it for the projects and all the tasks I want appears. However, if I try this for a section, I get an array with all of the tasks in the section. Can you look into this? Thanks in advance!


#2

@johnnygoodnow, @Matt_Bramlage, and @Jeff_Schneider


#3

Hi @Zhenye_Feng,

Thanks for reaching out. Can you share a bit more about what you’re trying to accomplish (as well as the code)? I’m not exactly certain what you’re building.


#4

Hi @Jeff_Schneider,

Thanks for replying! I’m trying to build a custom script that auto-completes tasks in a specific section. So I decided to query for all the incomplete tasks within a section with https://app.asana.com/api/1.0/tasks?completed_since=now&section=SECTION#, however, I get all of the tasks back from that section instead of the incomplete ones. If I do https://app.asana.com/api/1.0/tasks?completed_since=now&project=PROJECT# then I was able to grab all incomplete tasks for that project back.

I would love to hear your feedback for this and if there is any ways around this!


#5

Hi @Zhenye_Feng, thanks for providing the additional context. While what you’re building is certainly possible, it will require some client-side filtering.

We do hope to add more search features to the API in the nearish future. For now, you will need to request all incomplete tasks with their membership in the project (GET /projects/<project-id>/tasks?opt_expand=memberships&completed_since=now). Then iterate over these tasks to see which ones are in your desired section.

For board view projects only, you can GET /sections/section-id/tasks to request all the tasks within a column.

Good luck!


#6

Hi @Jeff_Schneider, thanks for the helpful suggestion. I was wondering if GET /sections/section-id/tasks?completed_since=now works or it is only a feature for projects.


#7

It only works for board view projects. Not list view.


#8

We do have board view enable, but the tasks?completed_since=now doesn’t seem to be working with sections.