How to find tasks pertaining to assignee and workspace in java (findAll())

Hi,
so I am currently trying to get a list of all the tasks for respective assignees to see whether their tasks have been completed yet or not.

I know the url request to make to the API is as follows: “https://app.asana.com/api/1.0/tasks?assignee=XXXXXXXXXXXXX&workspace=XXXXXXXXXX&opt_pretty&opt_fields=name,completed_at”.

However, I am trying to code this in java by running:

List tasks = client.tasks.findAll().execute();

Which of course returns “Invalid Request (You should specify one of workspace, project, tag, section, user_task_list)”

I have seen in the Asana docs that the way you would do this in php is to specify the parameters within findAll(assigneeID, workspaceID). Is there a similar method in java that I could utilise to obtain the same results?

Kind regards

Hi,

You should go and read the code of the Java library you are using :slight_smile: it is available on Github I believe? :thinking:


e.g.
client.tasks.findAll().query(“project”, 1234).option(“page_size”, 1000).execute();

1 Like

Thank you very much for your assistance. The query function was the last piece of the puzzle I was missing :slight_smile:

1 Like