Projects

Get task count of a project

<b>Required scope: </b><code>projects:read</code>

<table> <tr> <th>Field</th> <th>Required Scope</th> </tr> <tr> <td><code>team</code></td> <td><code>teams:read</code></td> </tr> <tr> <td><code>custom_type</code></td> <td><code>custom_types:read</code></td> </tr> </table>

Get an object that holds task count fields. All fields are excluded by default. You must opt in using opt_fields to get any information from this endpoint.

This endpoint has an additional rate limit and each field counts especially high against our cost limits.

Milestones are just tasks, so they are included in the num_tasks, num_incomplete_tasks, and num_completed_tasks counts.

get/projects/{project_gid}/task_counts

Request

  • Base URL: https://app.asana.com/api/1.0
  • URL: https://app.asana.com/api/1.0/projects/{project_gid}/task_counts
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.asana.com/-/oauth_authorize, token URL https://app.asana.com/-/oauth_token, scopes: projects:read)

Query parameters

opt_fieldsstring[]

This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. Properties can include nested fields. To learn more, see the input/output options guide.

Response

Successfully retrieved the requested project's task counts.

Example response

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

Changes

No recorded changes to this operation across all 2 revisions of this API.