# Get custom fields assigned to a task

**URL:** <https://forum.asana.com/t/get-custom-fields-assigned-to-a-task/106345>\
**Category:** API & Developers\
**Tags:** custom-fields\
**Created:** [15 January 2021 09:29 UTC](https://forum.asana.com/t/get-custom-fields-assigned-to-a-task/106345 "2021-01-15T09:29:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cody\_Christopulos](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/cody_christopulos/32/68757_2.png) [@Cody\_Christopulos](https://forum.asana.com/u/Cody_Christopulos)\
**Post date:** [15 January 2021 09:29 UTC](https://forum.asana.com/t/get-custom-fields-assigned-to-a-task/106345/1 "2021-01-15T09:29:28Z")

</div>

I am trying to filter tasks in a project by custom fields gids. Is this possible to do like filtering by tag gids? I have tried different things, but at best I only get ALL the custom fields associated with a task, not the specific ones assigned to it.  
This is how I’m filtering by tag gids.  
[https://app.asana.com/api/1.0/workspaces/{workspace#}/tasks/search?opt\_fields=name,notes&created\_at.after=2021-01-14T01:00:00.0000&created\_at.before=2021-01-14T23:59:59Z&tags.all=1057958658407,1142011060547883&projects.any={project](https://app.asana.com/api/1.0/workspaces/%7Bworkspace#%7D/tasks/search?opt_fields=name,notes&created_at.after=2021-01-14T01:00:00.0000&created_at.before=2021-01-14T23:59:59Z&tags.all=1057958658407,1142011060547883&projects.any=%7Bproject)#}

---

<div class="post-metadata">

**Author:** ![Cody\_Christopulos](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/cody_christopulos/32/68757_2.png) [@Cody\_Christopulos](https://forum.asana.com/u/Cody_Christopulos)\
**Post date:** [18 January 2021 14:06 UTC](https://forum.asana.com/t/get-custom-fields-assigned-to-a-task/106345/4 "2021-01-18T14:06:21Z")

</div>

I was able to solve this by getting a list of tasks and then getting custom\_fields, enum\_values. Python code looks like this:  
for i in task\_list:  
print (i)  
link = requests.get(f’[https://app.asana.com/api/1.0/tasks/{i}/?custom\_fields](https://app.asana.com/api/1.0/tasks/%7Bi%7D/?custom_fields)’, headers=headers)

```
	data = json.loads(link.content.decode())
	# print (data)
	dict = data
	custom_fields = dict["data"]["custom_fields"]
	notes = dict["data"]["notes"]
	name = dict["data"]["name"]
	gid = dict['data']['gid']
	# print (name)

# # print (notes)
	for i in custom_fields:
		enum_value = (i['enum_value'])

```

---

<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 19:06 UTC](https://forum.asana.com/t/get-custom-fields-assigned-to-a-task/106345/5 "2025-05-30T19:06:11Z")

</div>

Closed on 30 May 2025 19:06 UTC


