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
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?