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#}
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’, 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'])