New endpoint: project task counts

Hello all! With the growing set of high-level reporting and planning features Asana has been adding to our web app (timeline, portfolios, workload) we’ve decided to bring some additional high-level reporting functionality to the API: project task counts. When you view a list of projects in a portfolio or view a project’s “Progress” tab, you can see a count of complete and incomplete tasks and milestones in that project, and those counts are now in the API!

Specifically, by hitting GET /projects/<project-gid>/task_counts you can get six different counts for that project:

{
  "num_tasks": 150,
  "num_incomplete_tasks": 100,
  "num_completed_tasks": 50,
  "num_milestones": 10,
  "num_incomplete_milestones": 7,
  "num_completed_milestones": 3
}

A few things to note about this endpoint:

  • All fields are opt-in. You’ll need to use the opt_fields parameter to select which counts you want. Like the rest of our API, we encourage you to select only the fields you need.
  • This endpoint has a separate rate limit. You will be limited to 60 requests per minute, similar to the search API. These fields also count fairly high against our cost limits, so you should only opt-in to the fields you truly need.
  • Milestones are included in task counts. Milestones are a subtype of tasks, and so num_tasks and other task counts also include counts of milestones. In the above example, there are 150 tasks in the project, of which 140 have resource_subtype: "default_task" and 10 have resource_subtype: "milestone".

Take a look at our docs for more information. Happy reporting!

1 Like