Custom field with ID 0 is not on given object

custom-fields

#1

Trying to create a simple task with custom fields, but getting the error message above. The ID im specifiying is from the get custom fields endpoint for my org, so unsure where ID 0 is coming from.


#2

Hey @Evan_Kimia, thanks for reaching out. Sorry to hear you’re having issues.

Can you please provide the code for the request you are making and also the response you are getting so that we can reproduce and the issue?

Thanks!


#3

I am getting the same error:

{
  "data": {
    "assignee": "me",
    "notes": "test",
    "name": "test",
    "workspace": [WORKSPACE_NUMBER],
    "projects": [ PROJECT_NUMBER ],
    "custom_fields": [
        {
          "id": 536734496488696,
          "name": "Github Repo",
          "type": "enum",
          "enum_value": {
            "id": 539321952931050,
            "name": "example",
            "enabled": "true",
            "color": "none"
          }
        }
      ]
   }
}

#4

And here is the error:

{
    "errors": [
        {
            "message": "Custom field with ID 0 is not on given object ",
            "help": "For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors"
        }
    ]
}

#5

Solved it.

Needed to do the following:

custom_fields: {
    field_id: enum_id
}