find task by custom field

I’m trying to find an asana task in a certain project based on its custom field value.
I want to do this for an automation in make.com
But the cURL request doesn’t even give me the expected result.

[According to asanas docs it should be possible to find tasks by custom field](https:// developers. asana. com/reference/searchtasksforworkspace)

This forum question helped me to find the respective docs (but doesn’t give an actual answer)

But I only get an empty 200 response for this (with correct credentials):

curl --request GET \
     --url 'https://app.asana.com/api/1.0/workspaces/{workSpaceID}/tasks/search?projects.any={projectId}&custom_fields.{fieldId}.value={valueOfCustomField}&resource_subtype=milestone&sort_by=modified_at&sort_ascending=false' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {correctToken}'

This is the response I get in Mac terminal:

{"data":[]}

How to find the right task?

Hi @Samuel_Hartmann!

Is the custom field a multi-enum? Searching for values in a multi-enum is not supported by the search API.

Thanks for your reply.
It was just a number - not a multi-enum.

But I found the issue:
I had to remove the resource_subtype=milestone filter (which for some reason is included by default in the API explorer.

2 Likes

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