Fetch Custom Field value changes for each Status

I am trying to fetch changes in our status updates on a project over time. We use 2 custom fields to track risks. For example, our Status Updates look like so…

Status 1

I’m able to grab all the fields except for the two Custom Fields with arrows next to them. The /api/1.0/status_updates doesn’t appear to have a custom_fields property , but the UI certainly shows these updates over time so the data must be somewhere :smile:


Sample python code to test it out.

# pip install: asana
# pip install: rich

import datetime as dt

from asana.rest import ApiException
import asana
import rich


ASANA_ACCESS_TOKEN = "nope"
ASANA_PROJECT_GID = "nah"
ASANA_PROJECT_STATUS_GID = "noty"

# CONFIG
configuration = asana.Configuration()
configuration.access_token = ASANA_ACCESS_TOKEN

# API
api_client = asana.ApiClient(configuration)

# ENDPOINT
status_updates_api_instance = asana.StatusUpdatesApi(api_client)

opts = {
    'opt_fields': ",".join([
        "title",
        "created_at",
        "modified_at",
        "status_type",
        "text",

        # test attributes...
        "custom_fields",
        "parent",
        "resource_subtype",
    ]),
}

# DO THE WORK
try:
    api_response = status_updates_api_instance.get_status(ASANA_PROJECT_STATUS_GID, opts)
except ApiException as e:
    rich.print("Exception when calling StatusUpdatesApi->get_status: %s\n" % e)
else:
    rich.print(
        {
            "gid": ASANA_PROJECT_STATUS_GID,
            "project_id": ASANA_PROJECT_GID,
            "status": api_response["status_type"],
            "title": api_response["title"],
            "primary_risk": ...,
            "secondary_risk": ...,
            "description": api_response["text"],
            "created_at_datetime": api_response["created_at"],
            "modified_at_datetime": api_response["modified_at"],
            "_last_load_time": dt.datetime.now(),

            # test attributes...
            "extra": {
                "custom_fields": api_response.get("custom_fields"),
                "parent": api_response["parent"],
                "resource_subtype": api_response["resource_subtype"],
            }
        }
    )

Is there an API I can use to fetch this data?

Asana forums limit me from attaching more than 1 media file at once… so first two posts will show the custom fields being tracked across updates.

Status 2

Status 3

Hi @dr-ts! Welcome to the forum!

I don’t have an answer for you yet, but I am investigating and hope to give you an update soon.

1 Like

See also Create Status Asana Custom fields - #12 by Phil_Seeman

Thanks @Phil_Seeman ! I found that one during my searching before posting but saw it was from 2022.

Are we saying that this is still not possible with the public APIs, even though the client itself shows it happening? Asan appears to be able to query this infomration internally.

@dr-ts It’s still not possible AFAIK. @David_Neal might come back with additional info, perhaps.

1 Like

I, too, am interested in this.

There is a workaround (sort of) - place the project into a Portfolio, with that custom field (if you do not already do this - get the custom field to show in the Status update).

Then use the API to pull the portfolio entirely, with the custom field optional field, like this:

https://app.asana.com/api/1.0/portfolios/{portfolio_id}/items?opt_fields=custom_fields

This will expose the custom fields to you. However, you don’t get the history of them unfortunately - just the latest one.

1 Like