1

I am trying to develop summary data of length of time from task creation to task completion for all tasks in a certain team. I want to look at how lang it is taking from start to finish on tasks (on average) for any given month. My team has 30 - 40 projects and we move tasks from project to project until it is completed.

I have tried the following URL on the explorer page in their documentation:

GET /tasks?opt_fields=completed_at,completed&completed_since=2012-02-22T02%3A06%3A58.147Z&limit=10&workspace=[myworkspaceid]&project=[myprojectid]

The response I get is:

{   "errors": [
    {
      "message": "Must specify exactly one of project, tag, or assignee + workspace",
      "help": "For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors"
    }   ] }

Since I am specifying a project ID why am I getting this error?

************************ EDIT ************************************ OK...thanks for that. I am usding the following code and using only a workspace did indeed fix my issue. When I use the following code using asana gem in ruby I get results....363 results.

allTasks = client.tasks.find_all(assignee: nil, workspace: nil, project: 999999999999999999,completed_since: nil, modified_since: nil, per_page: 100, options: {})
allTasks.each do |task|
    puts task.name
end

Let's say the developer of the Asana gem messed up and is ignoring my "per_page: 100". Isn't Asana limited to 100 or less results? Why am I getting 363? How Do I know that this really is all of them?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Eric Snyder
  • 1,816
  • 3
  • 22
  • 46

1 Answers1

2

When you specify a project for the /tasks endpoint, you mustn't specify a workspace (the Asana API infers the workspace from the project). (Admittedly, the workspace could be optional, so I've filed this as a bug.)

Also, to directly answer your original question, we don't currently support directly querying for every task in a team. Fetching tasks in each project is the best approach.

Sean Wentzel
  • 165
  • 5