Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asana API - how to get incomplete tasks only?

Tags:

asana

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.

like image 900
M.R. Avatar asked Sep 01 '14 21:09

M.R.


People also ask

Can you hide certain tasks in Asana?

Hiding a section is not an option in Asana. What I would suggest you to do instead is to create a separate project which is private to you and have those tasks there. Through the usage of multi-homing you can also host in your private project the tasks from the public project.

Can I archive completed tasks in Asana?

Unfortunately, it is not possible to archive multiple projects at once, you'll need to archive them one per one. Tasks can't be archived, but they can be marked completed; if you need to mark multiple ones completed at once, simply use the multiselect function and mark all your tasks completed in one click!

Does Asana delete completed tasks?

Asana actually stores your tasks and projects, whether completed or archived (or not!), forever!


1 Answers

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 :-)

like image 124
agnoster Avatar answered Oct 01 '22 14:10

agnoster