Custom Field GID changes on each task.

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

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

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

Sure!

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

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:

Hope that helps!

Cheers,
Daniel

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

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:

1 Like