Search code examples
apiasana

asana api listing unassigned tasks in a workspace


I'd like to list all unassigned tasks in a given workspace using asana API. Tried using "assignee=null" as follows:

curl -u <api-key>: "https://app.asana.com/api/1.0/tasks?workspace=<id>&assignee=null"

but it returns the error below:

{
  "errors": [
    {
      "message": "assignee: Not an email, ID, or \"me\": null"
    }
  ]
}

Actually, any attempt to access tasks in a workspace without explicit assignee (me or assignee ID) fails, examples

curl -u <api-id>: "https://app.asana.com/api/1.0/tasks?workspace=<wid>&due_on=null&opt_pretty" 
curl -u <api-id>: "https://app.asana.com/api/1.0/tasks?workspace=<wid>&opt_fields=name,notes,assignee"

all return this error message

{
  "errors": [
    {
      "message": "assignee: Missing input"
    }
  ]
}

Unassigned tasks do have a null assignee when I list them, which I can do for a project but not for a workspace:

curl -u <api-key>: "https://app.asana.com/api/1.0/projects/<pid>/tasks?opt_fields=name,assignee,notes"

{
  "id": 123456789,
  "name": "watch asana vision talk",
  "assignee": null,
  "notes": "http://blog.asana.com/2011/02/asana-demo-vision-talk/"
}

But I cannot list them from a project either since assignee options are ignored (see also Asana API for Projects Assigned to Me)

Am I missing something? Help appreciated! Thank you.


Solution

  • You're not missing anything, adaria. Right now you can't get all tasks in a workspace - it could be too much data and we don't yet have any pagination in the API. The fact that you can't filter by both project AND assignee is something we hope to fix soon. For now I think your best option is to request all tasks project by project, ensure you get the assignee field (with opt_fields=assignee) and filter out assigned tasks on your end.