Asana: Update a goal metric
Asana goals.updateGoalMetric: arguments, response, policy and SDK examples.
← Goals operations · Get started
Operation asana.updategoalmetric
Provider route: POST /goals/{goal_gid}/setMetricCurrentValue. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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["goals"]["updateGoalMetric"]>[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.goals.updateGoalMetric(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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.goals.update_goal_metric(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.goal_gid | string | Required within parent | |
query | Model | Optional | Expand Get a goal — request body — query |
body | object | Required within parent | |
body.data | Model | Optional | Expand Update a goal metric — request body — body data |
Referenced models: Update a goal metric — request body — body data, Get a goal — request body — query
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | object | All variants apply | |
$ (allOf 1).data | Model | Optional | Expand Get a goal — response body — data data — Goal Response |
$ (allOf 2) | Model | All variants apply | Expand Get a goal — response body — data |
Referenced models: Get a goal — response body — data data — Goal Response, Get a goal — response body — data
Schemas
Section titled “Schemas”30 more schemas are linked from the tables above, on the schema pages.
Update a goal metric — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A generic Asana Resource, containing a globally unique identifier. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
current_number_value | number | Optional | *Conditional*. This number is the current value of a goal metric of type number. |
Get a goal — response body — data data — Goal Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Get a goal — response body — data data due on, gid, html notes, is workspace level, liked, name, notes, resource type, start on |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).likes | array | Optional | Array of likes for users who have liked this goal. Read only: true |
$ (allOf 2).likes[] | Model | Each item | Expand Get a story — response body — data / data / source: web, email, mobile, api, unknown, type: comment, system likes item |
$ (allOf 2).num_likes | JSON | Optional | |
$ (allOf 2).num_likes (anyOf 1) | integer | Alternative | The number of users who have liked this goal. Read only: true |
$ (allOf 2).num_likes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$ (allOf 2).team | JSON | Optional | |
$ (allOf 2).team (anyOf 1) | JSON | Alternative | |
$ (allOf 2).team (anyOf 1) (allOf 1) | Model | All variants apply | Expand Add a user to a team — response body — data data team — Team Compact |
$ (allOf 2).team (anyOf 1) (allOf 2) | object | All variants apply | *Conditional*. This property is only present when the `workspace` provided is an organization. |
$ (allOf 2).team (anyOf 2) | null | Alternative | |
$ (allOf 2).workspace | JSON | Optional | |
$ (allOf 2).workspace (allOf 1) | Model | All variants apply | Expand Update a workspace — request body — body data |
$ (allOf 2).workspace (allOf 2) | object | All variants apply | |
$ (allOf 2).followers | array | Optional | Array of users who are members of this goal. |
$ (allOf 2).followers[] | Model | Each item | Expand Get users in a team — response body — data data item |
$ (allOf 2).time_period | JSON | Optional | |
$ (allOf 2).time_period (anyOf 1) | JSON | Alternative | |
$ (allOf 2).time_period (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get time periods — response body — data, next page data item |
$ (allOf 2).time_period (anyOf 1) (allOf 2) | object | All variants apply | |
$ (allOf 2).time_period (anyOf 2) | null | Alternative | |
$ (allOf 2).metric | JSON | Optional | |
$ (allOf 2).metric (anyOf 1) | JSON | Alternative | |
$ (allOf 2).metric (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get a goal — response body — data / data / default_access_level: admin, editor, commenter, viewer, privacy setting: public to workspace, members only metric resource subtype: number, unit: none, currency, percentage resource subtype: number, unit: none, currency, percentage |
$ (allOf 2).metric (anyOf 1) (allOf 2) | object | All variants apply | |
$ (allOf 2).metric (anyOf 1) (allOf 2).can_manage | boolean | Optional | *Conditional*. Only relevant for `progress_source` of type `external`. This boolean indicates whether the requester has the ability to update the current value of this metric. This returns `true` if the external metric was created by the requester, `false` otherwise. Read only: true |
$ (allOf 2).metric (anyOf 2) | null | Alternative | |
$ (allOf 2).owner | JSON | Optional | |
$ (allOf 2).owner (anyOf 1) | JSON | Alternative | |
$ (allOf 2).owner (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get users in a team — response body — data data item |
$ (allOf 2).owner (anyOf 1) (allOf 2) | object | All variants apply | |
$ (allOf 2).owner (anyOf 2) | null | Alternative | |
$ (allOf 2).current_status_update | JSON | Optional | |
$ (allOf 2).current_status_update (anyOf 1) | JSON | Alternative | |
$ (allOf 2).current_status_update (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get status updates from an object — response body — data, next page data item |
$ (allOf 2).current_status_update (anyOf 1) (allOf 2) | JSON | All variants apply | The latest `status_update` posted to this goal. |
$ (allOf 2).current_status_update (anyOf 2) | null | Alternative | |
$ (allOf 2).status | JSON | Optional | |
$ (allOf 2).status (anyOf 1) | string | Alternative | The current status of this goal. When the goal is open, its status can be `green`, `yellow`, and `red` to reflect "On Track", "At Risk", and "Off Track", respectively. When the goal is closed, the value can be `missed`, `achieved`, `partial`, or `dropped`. *Note* you can only write to this property if `metric` is set. Read only: true |
$ (allOf 2).status (anyOf 2) | null | Alternative | |
$ (allOf 2).privacy_setting | string | Optional | The privacy setting of the goal. Known values: public_to_workspace, members_only |
$ (allOf 2).default_access_level | string | Optional | The default access level when inviting new members to the goal Known values: admin, editor, commenter, viewer |
$ (allOf 2).custom_fields | array | Optional | Array of custom field values applied directly to the goal itself. These represent the values set on the goal, not the fields available for items in the goal. |
$ (allOf 2).custom_fields[] | Model | Each item | Expand Get a membership — response body — data / data / access_level: admin, editor, user parent |
$ (allOf 2).custom_field_settings | array | Optional | Array of custom field definitions that are enabled for the goal. These represent which custom fields are available to be used on items within the goal, but do not include any values. |
$ (allOf 2).custom_field_settings[] | Model | Each item | Expand Add a custom field to a project — response body — data data — Custom Field Setting Response |
Referenced models: Get a goal — response body — data data due on, gid, html notes, is workspace level, liked, name, notes, resource type, start on, Get a story — response body — data / data / source: web, email, mobile, api, unknown, type: comment, system likes item, Get a membership — response body — data / data / access_level: admin, editor, user parent, Add a custom field to a project — response body — data data — Custom Field Setting Response, Get a goal — response body — data / data / default_access_level: admin, editor, commenter, viewer, privacy setting: public to workspace, members only metric resource subtype: number, unit: none, currency, percentage resource subtype: number, unit: none, currency, percentage, Get status updates from an object — response body — data, next page data item, Add a user to a team — response body — data data team — Team Compact, Get time periods — response body — data, next page data item, Get users in a team — response body — data data item, Update a workspace — request body — body data
Get a goal — response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Required within parent | Expand Get a goal — response body — data data — sdk__Goal Response |
Referenced models: Get a goal — response body — data data — sdk__Goal Response
Get a goal — response body — data data due on, gid, html notes, is workspace level, liked, name, notes, resource type, start on
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A generic Asana Resource, containing a globally unique identifier. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | The name of the goal. |
html_notes | string | Optional | The notes of the goal with formatting as HTML. See [rich text](/docs/rich-text). |
notes | string | Optional | Free-form textual information associated with the goal (i.e. its description). |
due_on | JSON | Optional | |
due_on (anyOf 1) | string | Alternative | The localized day on which this goal is due. This takes a date with format `YYYY-MM-DD`. |
due_on (anyOf 2) | null | Alternative | |
start_on | JSON | Optional | |
start_on (anyOf 1) | string | Alternative | The day on which work for this goal begins, or null if the goal has no start date. This takes a date with `YYYY-MM-DD` format, and cannot be set unless there is an accompanying due date. |
start_on (anyOf 2) | null | Alternative | |
is_workspace_level | boolean | Optional | *Conditional*. This property is only present when the `workspace` provided is an organization. Whether the goal belongs to the `workspace` (and is listed as part of the workspace’s goals) or not. If it isn’t a workspace-level goal, it is a team-level goal, and is associated with the goal’s team. |
liked | boolean | Optional | True if the goal is liked by the authorized user, false if not. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: asana.updategoalmetric. Catalog operation: asana:updateGoalMetric. 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.