I’m trying to read the values of a custom field for a task using https://app.asana.com/api/1.0/projects/{project_gid}/tasks.
Please note that the following snippets have been redacted and GIDs appear malformed. They are correctly formed in the actual calls.
This is what the call looks like:
curl --request GET --url 'https://app.asana.com/api/1.0/projects/1------------2/tasks?opt_fields=custom_fields' --header 'accept: application/json' \
--header 'authorization: Bearer ey...dHKaSo' | jq
Most of the time, the response looks like this, incorrectly showing no people_value or display_value for the given custom field.
{
"data": [
....,
{
"gid": "1-----------------1",
"custom_fields": [
{
"gid": "1--------------------4",
"enabled": true,
"name": "Tester",
"description": "",
"created_by": {
"gid": "1--------------------------7",
"name": "S--------------n",
"resource_type": "user"
},
"display_value": "",
"resource_subtype": "people",
"resource_type": "custom_field",
"people_value": [],
"is_formula_field": false,
"is_value_read_only": false,
"type": "people"
}
]
}
]
}
I’ve received the correct response once, in hundreds of attempts. Note that the people_value field is a non-empty array, and display_value is set accordingly. That looks like this:
{
"data": [
...,
{
"gid": "1-----------------1",
"custom_fields": [
{
"gid": "1--------------------4",
"enabled": true,
"name": "Tester",
"description": "",
"created_by": {
"gid": "1--------------------------7",
"name": "S--------------n",
"resource_type": "user"
},
"display_value": "S--------------n, J---------------------m",
"resource_subtype": "people",
"resource_type": "custom_field",
"people_value": [
{
"gid": "1--------------------------7",
"name": "S--------------n",
"resource_type": "user"
},
{
"gid": "1-----------------2",
"name": "J---------------------m",
"resource_type": "user"
}
],
"is_formula_field": false,
"is_value_read_only": false,
"type": "people"
}
]
}
]
}
I’ve made no changes to the resources or my access levels to them while testing these requests.
Any ideas?