Find all tasks assigned to specific user

Hi, I manage a team and they can have tasks across any number of projects. Those projects can change and it’s not feasible for me to keep an eye on all of them. I am trying to use an API to just get all tasks assigned to a specific user. Right now in the UI the way I am accomplishing this is a saved search that looks something like
https://app.asana.com/0/search?searched_type=task&assignees.ids=1234

I thought I’d either be able to use that search param somewhere or maybe there is a tasks by user endpoint but can’t really find either. Can someone help me out here? Basically I want to pull back all tasks where asignee = x, with no other filters. I know how to get user ids so I just need that last piece.

Hi and welcome @Michael_Andrews5,

The equivalent in the API is the Search API. You’ll want to use it with the assignee.any=<user_gid> parameter.

Looking at that, it is still workspace specific though correct? I was trying to not have to get a list of work spaces and then query them all

Yes; Asana workspaces are pretty well walled-off from each other (for security purposes and also due to possible data storage in different server location globally).

Hi Phil, I’m just now getting back to this, thanks for the help. I think the last question I have is I can’t seem to get the title of a given task from the search endpoint you gave me. For context, I’m building a web page that lists tasks that are assigned by employee. So I just have to loop through a list of employee IDs and hit that search. The data I want to show is projects it’s assigned to, the created date, the last modified date, and the title of the task. Maybe I’m just missing the keyword in the documentation but I don’t see how I get the title from that? I’m trying to avoid having to make a request per task to get the title, but if that is what i need to do I can, just trying to keep the api calls to a minimum if I can. Am I just missing what property to query? Here is what I have so far, thanks!

https://app.asana.com/api/1.0/workspaces/1234/tasks/search?opt_fields=start_on,projects.name,approval_status,created_at,modified_at,custom_fields.name,custom_fields.display_value&sort_by=modified_at&assignee.any=1234

@Michael_Andrews5
Add name to the opt_fields list, that should do it.

1 Like