# Get tasks from a project returns incorrect and unpredictable custom field values.

**URL:** <https://forum.asana.com/t/get-tasks-from-a-project-returns-incorrect-and-unpredictable-custom-field-values/872311>\
**Category:** API & Developers\
**Tags:** custom-fields, tasks\
**Created:** [25 July 2024 19:20 UTC](https://forum.asana.com/t/get-tasks-from-a-project-returns-incorrect-and-unpredictable-custom-field-values/872311 "2024-07-25T19:20:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GhostOfBobSaget](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/ghostofbobsaget/32/124440_2.png) [@GhostOfBobSaget](https://forum.asana.com/u/GhostOfBobSaget)\
**Post date:** [25 July 2024 19:20 UTC](https://forum.asana.com/t/get-tasks-from-a-project-returns-incorrect-and-unpredictable-custom-field-values/872311/1 "2024-07-25T19:20:46Z")

</div>

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](https://app.asana.com/api/1.0/projects/%7Bproject_gid%7D/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:

```auto
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.

```auto
{
  "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:

```auto
{
  "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?

---

<div class="post-metadata">

**Author:** ![GhostOfBobSaget](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/ghostofbobsaget/32/124440_2.png) [@GhostOfBobSaget](https://forum.asana.com/u/GhostOfBobSaget)\
**Post date:** [1 August 2024 21:35 UTC](https://forum.asana.com/t/get-tasks-from-a-project-returns-incorrect-and-unpredictable-custom-field-values/872311/2 "2024-08-01T21:35:55Z")

</div>

Bump

---

<div class="post-metadata">

**Author:** ![David\_Neal](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/david_neal/32/242025_2.png) [@David\_Neal](https://forum.asana.com/u/David_Neal)\
**Post date:** [5 August 2024 16:29 UTC](https://forum.asana.com/t/get-tasks-from-a-project-returns-incorrect-and-unpredictable-custom-field-values/872311/3 "2024-08-05T16:29:59Z")

</div>

The response where the `people_value` is an empty array and `display_value` is an empty string looks like the right response if that particular task does not have any people assigned to that custom field. If you take the task GID of one those tasks where the `people_value` is an empty array, and make an API call to [get only that task](https://developers.asana.com/reference/gettask), do you get a different result?

```sh
curl --request GET 
  --url 'https://app.asana.com/api/1.0/tasks/1234567890?opt_fields=custom_fields
  --header 'authorization: Bearer asdf...xyz'

```

---

<div class="post-metadata">

**Author:** ![GhostOfBobSaget](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/ghostofbobsaget/32/124440_2.png) [@GhostOfBobSaget](https://forum.asana.com/u/GhostOfBobSaget)\
**Post date:** [13 August 2024 18:53 UTC](https://forum.asana.com/t/get-tasks-from-a-project-returns-incorrect-and-unpredictable-custom-field-values/872311/4 "2024-08-13T18:53:46Z")

</div>

I haven’t had a chance to test your theory, but thank you for the reply. I’ll give it a whirl when I get a chance to get back to that particular piece of code.

Might be worth noting, the original requests were all for the same data. I was making repeated requests for the same set of tasks from the same project and seeing different results.
