# How to get the custom fields when getting the project?

**URL:** <https://forum.asana.com/t/how-to-get-the-custom-fields-when-getting-the-project/455908>\
**Category:** API & Developers\
**Tags:** custom-fields, projects\
**Created:** [16 June 2023 04:01 UTC](https://forum.asana.com/t/how-to-get-the-custom-fields-when-getting-the-project/455908 "2023-06-16T04:01:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shahidul\_Islam\_Prant](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/shahidul_islam_prant/32/176982_2.png) [@Shahidul\_Islam\_Prant](https://forum.asana.com/u/Shahidul_Islam_Prant)\
**Post date:** [16 June 2023 04:01 UTC](https://forum.asana.com/t/how-to-get-the-custom-fields-when-getting-the-project/455908/1 "2023-06-16T04:01:44Z")

</div>

I have been trying to get the custom field values for example Priority, Membership. But I am unsure of what to put on the API endpoint. I have got the images to show what I have tried so far.

This is the fields on my Asana project. The first row has value for Priority and Membership. I have got fields: Assignee, Due date, Priority, Membership

* * *

I am sending the API Request with the query parameters you can see in the image. The opt\_fields are : name,due\_on,completed,assignee,priorities,Membership

* * *

But I am only getting values of Fields and not getting values for custom fields Priority and Membership.

 ![4](https://us1.discourse-cdn.com/asana/original/3X/8/4/8487e1601cad12b57804d96ce090c8959fff530c.jpeg)  
`1

---

<div class="post-metadata">

**Author:** ![Larry\_Berger\_lpb](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/larry_berger_lpb/32/276017_2.png) [@Larry\_Berger\_lpb](https://forum.asana.com/u/Larry_Berger_lpb)\
**Post date:** [16 June 2023 04:25 UTC](https://forum.asana.com/t/how-to-get-the-custom-fields-when-getting-the-project/455908/2 "2023-06-16T04:25:44Z")

</div>

Welcome, @Shahidul_Islam_Prant,

You need to ask for the field `custom_fields` which will return an array of all the custom fields for the task.

Here’s info from [Build an app with Asana](https://developers.asana.com/docs)

Accessing custom field values on tasks or projects

The [tasks](https://developers.asana.com/reference/gettask) reference has information on how custom fields look on tasks. custom fields will return as an array on the property `custom_fields`, and each entry will contain, side-by-side, the compact representation of the custom field metadata and a `{typename}_value` property that stores the value set for the  
custom field.

Of particular note is that the top-level `gid` of each entry in the `custom_fields` array is the `gid` of the custom field metadata, as it is the compact representation of this metadata. This can be used to refer to the full metadata by making a request to the `/custom_fields/{custom_fields_id}` endpoint as described above.

```auto
curl --request GET \
     --url 'https://app.asana.com/api/1.0/tasks/9999999999999?opt_fields=custom_fields' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer 0/...'

```

Larry

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [16 June 2023 13:36 UTC](https://forum.asana.com/t/how-to-get-the-custom-fields-when-getting-the-project/455908/3 "2023-06-16T13:36:15Z")

</div>

> [@Shahidul\_Islam\_Prant](#):
>
> Membership

In addition to @Larry_Berger_lpb 's excellent answer, if you’re referring here to the Asana `memberships` property, note that it’s not a custom field but rather is a built-in property on a task (and is plural, so you would ask for `opt_fields=memberships`):

![image](https://us1.discourse-cdn.com/asana/original/3X/6/e/6ea299927bdfb19aebc501689d3b8511f1aeeaf6.png)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [23 June 2023 13:36 UTC](https://forum.asana.com/t/how-to-get-the-custom-fields-when-getting-the-project/455908/4 "2023-06-23T13:36:22Z")

</div>

Closed on 23 June 2023 13:36 UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
