Skip to content

Asana: Get a task

Asana tasks.getTask: arguments, response, policy and SDK examples.

← Tasks operations · Get started

Operation asana.gettask

Provider route: GET /tasks/{task_gid}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/asana with npm, or alter-sdk-asana with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { AsanaIntegration } from "@alter-ai/asana";
async function execute(input: Parameters<AsanaIntegration["tasks"]["getTask"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new AsanaIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.tasks.getTask(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_asana import AsanaIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = AsanaIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.tasks.get_task(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.task_gidstringRequired within parent
queryModelOptionalExpand Get a task — request body — query

Referenced models: Get a task — request body — query

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)objectAll variants apply
$ (allOf 1).dataModelOptionalExpand Get a task — response body — data data — Task Response
$ (allOf 2)ModelAll variants applyExpand Get a task — response body — data

Referenced models: Get a task — response body — data data — Task Response, Get a task — response body — data

34 more schemas are linked from the tables above, on the schema pages.

Get a task — response body — data data — Task Response
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand Get a task — response body — data / data / approval_status: pending, approved, rejected, changes requested, assignee status: today, upcoming, later, new, inbox, resource subtype: default task, milestone, approval, custom
$ (allOf 2)objectAll variants apply
$ (allOf 2).assigneeJSONOptional
$ (allOf 2).assignee (anyOf 1)JSONAlternative
$ (allOf 2).assignee (anyOf 1) (allOf 1)ModelAll variants applyExpand Get users in a team — response body — data data item
$ (allOf 2).assignee (anyOf 1) (allOf 2)JSONAll variants apply
$ (allOf 2).assignee (anyOf 2)nullAlternative
$ (allOf 2).assignee_sectionJSONOptional
$ (allOf 2).assignee_section (anyOf 1)JSONAlternative
$ (allOf 2).assignee_section (anyOf 1) (allOf 1)ModelAll variants applyExpand Get sections in a project — response body — data, next page data item
$ (allOf 2).assignee_section (anyOf 1) (allOf 2)objectAll variants applyThe *assignee section* is a subdivision of a project that groups tasks together in the assignee's "My tasks" list. It can either be a header above a list of tasks in a list view or a column in a board view of "My tasks."
The `assignee_section` property will be returned in the response only if the request was sent by the user who is the assignee of the task. Note that you can only write to `assignee_section` with the gid of an existing section visible in the user's "My tasks" list.
$ (allOf 2).assignee_section (anyOf 2)nullAlternative
$ (allOf 2).custom_fieldsarrayOptionalArray of custom field values applied to the task. These represent the custom field values recorded on this project for a particular custom field. For example, these custom field values will contain an `enum_value` property for custom fields of type `enum`, a `text_value` property for custom fields of type `text`, and so on. Please note that the `gid` returned on each custom field value *is identical* to the `gid` of the custom field, which allows referencing the custom field metadata through the `/custom_fields/custom_field_gid` endpoint. The array includes custom fields from projects the task belongs to directly and from projects inherited from its full ancestor chain.
Read only: true
$ (allOf 2).custom_fields[]ModelEach itemExpand Get a custom field — response body — data data — Custom Field Response
$ (allOf 2).custom_typeJSONOptional
$ (allOf 2).custom_type (anyOf 1)JSONAlternative
$ (allOf 2).custom_type (anyOf 1) (allOf 1)ModelAll variants applyExpand Get a custom type — response body — data data asana created type identifier, gid, name, resource type
$ (allOf 2).custom_type (anyOf 1) (allOf 2)JSONAll variants apply
$ (allOf 2).custom_type (anyOf 2)nullAlternative
$ (allOf 2).custom_type_status_optionJSONOptional
$ (allOf 2).custom_type_status_option (anyOf 1)JSONAlternative
$ (allOf 2).custom_type_status_option (anyOf 1) (allOf 1)ModelAll variants applyExpand Get a task — response body — data data assignee, assignee section, custom fields, custom type, custom type status option, effective memberships, followers, parent, permalink url, projects, tags, workspace custom type status option gid, name, resource type gid, name, resource type
$ (allOf 2).custom_type_status_option (anyOf 1) (allOf 2)JSONAll variants apply
$ (allOf 2).custom_type_status_option (anyOf 2)nullAlternative
$ (allOf 2).followersarrayOptionalArray of users following this task.
Read only: true
$ (allOf 2).followers[]ModelEach itemExpand Get users in a team — response body — data data item
$ (allOf 2).parentJSONOptional
$ (allOf 2).parent (anyOf 1)JSONAlternative
$ (allOf 2).parent (anyOf 1) (allOf 1)ModelAll variants applyExpand Search tasks in a workspace — response body — data data item
$ (allOf 2).parent (anyOf 1) (allOf 2)objectAll variants applyThe parent of this task, or `null` if this is not a subtask. This property cannot be modified using a PUT request but you can change it with the `setParent` endpoint. You can create subtasks by using the subtasks endpoint.
Read only: true
$ (allOf 2).parent (anyOf 2)nullAlternative
$ (allOf 2).projectsarrayOptional*Create-only.* Array of projects this task is directly associated with. At task creation time, this array can be used to add the task to many projects at once. After task creation, these associations can be modified using the addProject and removeProject endpoints.
Read only: true
$ (allOf 2).projects[]ModelEach itemExpand Search projects in a workspace — response body — data data item
$ (allOf 2).effective_membershipsarrayOptional<p><strong style={{ color: "#4573D2" }}>Full object requires scope: </strong><code>projects:read</code>, <code>project_sections:read</code></p>

Opt-in, read-only. The union of direct and inherited memberships for this task. If the task is both directly associated with and inherits the same project, the direct membership takes precedence.
Read only: true
$ (allOf 2).effective_memberships[]ModelEach itemExpand Get a task — response body — data data assignee, assignee section, custom fields, custom type, custom type status option, effective memberships, followers, parent, permalink url, projects, tags, workspace effective memberships item
$ (allOf 2).tagsarrayOptionalArray of tags associated with this task. In order to change tags on an existing task use `addTag` and `removeTag`.
Read only: true
$ (allOf 2).tags[]ModelEach itemExpand Get a task's tags — response body — data, next page data item
$ (allOf 2).workspaceJSONOptional
$ (allOf 2).workspace (allOf 1)ModelAll variants applyExpand Update a workspace — request body — body data
$ (allOf 2).workspace (allOf 2)objectAll variants apply*Create-only*. The workspace this task is associated with. Once created, task cannot be moved to a different workspace. This attribute can only be specified at creation time.
Read only: true
$ (allOf 2).permalink_urlstringOptionalA url that points directly to the object within Asana.
Read only: true

Referenced models: Get a task — response body — data data assignee, assignee section, custom fields, custom type, custom type status option, effective memberships, followers, parent, permalink url, projects, tags, workspace custom type status option gid, name, resource type gid, name, resource type, Get a custom field — response body — data data — Custom Field Response, Get a custom type — response body — data data asana created type identifier, gid, name, resource type, Get a task — response body — data data assignee, assignee section, custom fields, custom type, custom type status option, effective memberships, followers, parent, permalink url, projects, tags, workspace effective memberships item, Search projects in a workspace — response body — data data item, Get sections in a project — response body — data, next page data item, Get a task's tags — response body — data, next page data item, Get a task — response body — data / data / approval_status: pending, approved, rejected, changes requested, assignee status: today, upcoming, later, new, inbox, resource subtype: default task, milestone, approval, custom, Search tasks in a workspace — response body — data data item, Get users in a team — response body — data data item, Update a workspace — request body — body data

Get a task — response body — data
FieldTypePresenceDescription and constraints
$objectRoot
dataModelRequired within parentExpand Get a task — response body — data data — sdk__Task Response

Referenced models: Get a task — response body — data data — sdk__Task Response

Get a task — response body — data data assignee, assignee section, custom fields, custom type, custom type status option, effective memberships, followers, parent, permalink url, projects, tags, workspace custom type status option gid, name, resource type gid, name, resource type
FieldTypePresenceDescription and constraints
$objectRoot<p><strong style={{ color: "#4573D2" }}>Full object requires scope: </strong><code>custom_types:read</code></p>

A generic Asana Resource, containing a globally unique identifier.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
namestringOptionalThe name of the custom type status option.
Get sections in a project — response body — data, next page data item
FieldTypePresenceDescription and constraints
$objectRootA *section* is a subdivision of a project that groups tasks together. It can either be a header above a list of tasks in a list view or a column in a board view of a project.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
namestringOptionalThe name of the section (i.e. the text displayed as the section header).

SDK function policy ID: asana.gettask. Catalog operation: asana:getTask. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["tasks:read"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.