pythonpython-3.xasanaasana-apiasana-connect

Asana Python API : Find all tasks that are unassigned in a workspace


I am using the python-asana API,

https://github.com/Asana/python-asana

Using this, it is very easy to get all tasks in a workspace if I specify the task assignee and the workspace, like so,

task_fields = ["this.workspace", "this.name", "this.created_at", "this.completed", "this.assignee_status", "this.completed_at", "this.name", "this.project"]
tasks=client.tasks.find_all({"opt_fields":task_fields}, assignee = 'xxxxxxxx', workspace = xxxxxx, iterator_type='items')

However, I want do some task maintenance/pruning and would like to get a list of all tasks that are not assigned to anyone. I believe the assignee field in this API does not accept 'null' and I cannot make this query without specifying the assignee.

Does anyone know how to do this?


Solution

  • While you can create and update tasks with assignee=null, you cannot query for unassigned tasks. You would need to get all of the tasks you wish to prune and then filter for the unassigned ones on your side.