# Custom Field GID changes on each task.

**URL:** <https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423>\
**Category:** API & Developers\
**Tags:** custom-fields\
**Created:** [14 May 2020 00:03 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423 "2020-05-14T00:03:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon31743107](https://luna1.co/8d76cd.png) [@anon31743107](https://forum.asana.com/u/anon31743107)\
**Post date:** [14 May 2020 00:03 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/1 "2020-05-14T00:03:34Z")

</div>

I have a project template that defined a custom field ( ‘is\_global\_to\_workspace’: True), what I am seeing is that every new project generated from that template will indeed have the custom field on all tasks but on each different task the custom field GID will be different making the tasks search by custom\_fields.{gid}.value ([Search tasks in a workspace](https://developers.asana.com/docs/search-tasks-in-a-workspace)) not return any result.  
Please advise on how to perform a workspace tasks search with custom field value filtering.  
Thanks,  
Arjuna

---

<div class="post-metadata">

**Author:** ![Daniel\_Iversen](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/daniel_iversen/32/27503_2.png) [@Daniel\_Iversen](https://forum.asana.com/u/Daniel_Iversen)\
**Post date:** [20 May 2020 05:22 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/2 "2020-05-20T05:22:38Z")

</div>

Hi Arjuna,

Is the Custom Field you’ve created an “org-wide”/shared field? If not then it probably could be why it get a new ID for each project (because then in fact they are treated as independent fields).

Cheers,  
Daniel

---

<div class="post-metadata">

**Author:** ![anon31743107](https://luna1.co/8d76cd.png) [@anon31743107](https://forum.asana.com/u/anon31743107)\
**Post date:** [20 May 2020 15:59 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/3 "2020-05-20T15:59:04Z")

</div>

> Is the Custom Field you’ve created an “org-wide”/shared field?

I don’t know, let me ask. Eventually do you have any doc on how to create an org-wide field so that it can have a GID that is global and unique?  
Thanks,  
Arjuna

---

<div class="post-metadata">

**Author:** ![Daniel\_Iversen](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/daniel_iversen/32/27503_2.png) [@Daniel\_Iversen](https://forum.asana.com/u/Daniel_Iversen)\
**Post date:** [21 May 2020 07:34 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/4 "2020-05-21T07:34:32Z")

</div>

Sure!

Here’s how to create a “global” Custom Field via the UI first:

> **[Custom fields](https://help.asana.com/hc/en-us/articles/14110099577883-Custom-fields)**
>
> Available on Asana Starter, Advanced, Enterprise, and Enterprise+ tiers, as well as legacy tiers Premium, Business, and Legacy Enterprise.Visit our pricing page for more information.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Cust...

And for the API to then to be able to assign it to tasks, you have to first add the Custom Field to the project (before trying to use it on tasks), as per @Matt_Bramlage’s instructions here:

> [@Create a task with an existing custom Field](https://forum.asana.com/t/create-a-task-with-an-existing-custom-field/28889/9):
>
> I can verify that there are no custom fields set on that project. If you’re looking to do this in the API, you can POST a request to [/projects/:project\_id/addCustomFieldSetting](https://asana.com/developers/api-reference/projects#custom-field-settings), which will associate the custom field with the project. Then it should be possible to set the value of the custom field on the task as above.

Hope that helps!

Cheers,  
Daniel

---

<div class="post-metadata">

**Author:** ![anon31743107](https://luna1.co/8d76cd.png) [@anon31743107](https://forum.asana.com/u/anon31743107)\
**Post date:** [21 May 2020 18:32 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/5 "2020-05-21T18:32:41Z")

</div>

Thank you @Daniel_Iversen! So if I understand correctly to associate a global custom field to a project I need to issue that POST request, right? Is this true also for projects cloned from a template? Since we create new projects from a base template is there a way to have the projects to automatically get the global custom field (with stable GID)?

---

<div class="post-metadata">

**Author:** ![Daniel\_Iversen](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/daniel_iversen/32/27503_2.png) [@Daniel\_Iversen](https://forum.asana.com/u/Daniel_Iversen)\
**Post date:** [22 May 2020 06:17 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/6 "2020-05-22T06:17:32Z")

</div>

If:

- The project was created from a template
- You can validate in the template (by looking in the Asana UI) that the field in the template is a global field in your "library)
- You can see (just to sanity check) in the UI that a new project created with the template does have that custom field as well

… then the GID should be the same - do note that it looks like from a super quick test that there are multiple GIDs in the response (naturally) so make sure you pick the right one - the one I underlined from the JSON response of /projects/{gid} shows the global reusable GID of a custom field:

[![](https://us1.discourse-cdn.com/asana/original/3X/b/0/b01433fdf4aa9b4149ffdfc6a3793764448f467f.png) ](https://dl.dropboxusercontent.com/s/m8nqhk7y7ls3jie/Screenshot%202020-05-22%2016.14.12.png?dl=0)

---

<div class="post-metadata">

**Author:** ![Suryakant\_Mahadev\_Mo](https://luna1.co/8d76cd.png) [@Suryakant\_Mahadev\_Mo](https://forum.asana.com/u/Suryakant_Mahadev_Mo)\
**Post date:** [9 April 2022 06:53 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/7 "2022-04-09T06:53:10Z")

</div>

Hello Daniel, Can you share the common request format to get all this information?

---

<div class="post-metadata">

**Author:** ![Suryakant\_Mahadev\_Mo](https://luna1.co/8d76cd.png) [@Suryakant\_Mahadev\_Mo](https://forum.asana.com/u/Suryakant_Mahadev_Mo)\
**Post date:** [9 April 2022 06:56 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/8 "2022-04-09T06:56:38Z")

</div>

@Daniel_Iversen I need all gid for automation, custom field gid, project templet gid and many more.

---

<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:** [30 May 2025 18:56 UTC](https://forum.asana.com/t/custom-field-gid-changes-on-each-task/83423/9 "2025-05-30T18:56:46Z")

</div>

Closed on 30 May 2025 18:56 UTC


