Error python InvalidRequestError: Invalid Request: You must specify at least one search filter

Hi,
Hello,
I’m trying to extract with python all the tasks assigned to me in a project using the following call:

tasks = client.tasks.search_tasks_for_workspace (workspace_gid, {‘projects_any’: ‘12001413023xxxxxx’, ‘assignee_any’: ‘12002270032xxxxxx’, ‘created_on_before’: ‘2022-10-26’}, opt_fields = {'name, created_at, (this .created_by.name), modified_at, (this.assignee.name), completed, completed_at, parent.name '})

But the following error is returned:

asana \ client.py ", line 93, in request
raise STATUS_MAP [response.status_code] (response)
asana.error.InvalidRequestError: Invalid Request: You must specify at least one search filter.

Hi @alessandro.moffa , welcome to the forum!

Can you set “projects.any” instead of “projects_any” ? Try to use the “dot” instead, but I don’t know if it is allowed in python…

Also, try to set opt_fields like that instead:

opt_fields = {'name, created_at, created_by.name, modified_at, assignee.name, completed, completed_at, parent.name '}

FM

1 Like

it worked with the “dot”.
Thank you

1 Like