Asana API - how to get incomplete tasks only?

旧街凉风 提交于 2019-12-06 06:19:57

问题


How do I get a list of tasks from a project that are incomplete? I tried to add ?completed=false and ?completed=0 at the end of the tasks URL:

https://app.asana.com/api/1.0/projects/[project id]/tasks?completed=false

... doesn't seem to work. Whether its set to true or false, it is always returning the same tasks. I've spot checked to make sure there are completed tasks in there.

background info: I'm only trying to do this so that I don't get the entire list of tasks all the time. I need the entire list of tasks because right now as I understand it there is no way to get the section a task is in.


回答1:


Under "Querying for Tasks" in the Developer Documentation you'll find the parameters you can pass to select different tasks. We don't support generalized queries (like completed=false) but we do have e.g. completed_since, which returns all "incomplete or completed since X" tasks. So, if you only want incomplete tasks, you can pass completed_since=now (since no completed tasks have been completed since the current time, it will only return incomplete tasks). It's not exactly intuitive, but it works :-)



来源:https://stackoverflow.com/questions/25613230/asana-api-how-to-get-incomplete-tasks-only

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!