Api error: custom_fields: Value cannot be an array: []

We’ve been having this bug all of sudden. This breaks our integration with Asana (used to created tasks).

We have changed nothing to the way we format custom fields when creating tasks through the API. Is it possible that something changed in Asana that breaks this?

1 Like

Hmmm, personally I’m not aware of anything that’s changed. Can you post an example of a request that you’re sending to Asana to create a new task?

We are experiencing the same issue. We’ve had this integration working for over a year and it suddenly broke this week with the same error.

Here is the format we were using to post to custom fields:

“&custom_fields[1103791202147498]=283308935”

Someone else suggested using “custom_field” singular, which removes the error but now the custom_fields are not posting.

I’m working on troubleshooting and will update here if I figure out how to solve it!

All Asana GIDs now need to be strings; I wonder if that’s the problem here?

Thanks for the help! It’s weird that the syntax suddenly stopped working between Friday and Monday, right? The deprecation docs show the string change ended on 2/11 but this was working on 2/28: https://developers.asana.com/docs/#deprecations

Agreed. They actually had to delay two extra days until 2/13, but still your point and your puzzlement are valid.

I fixed it by formatting it like this which is how it’s documented:

&custom_fields={“1103791202147498”:"283308935”}

It did use to work the other way though :slight_smile:

1 Like

We are actually sending the right format, which is an object of gid key/gid value pairs like such:

{ ‘1148325721309890’: ‘1148325721309893’ }

Don’t know why the api is mentionning an array…

We’re trying every variation possible to no avail.

Any ideas?

Just to provide more context, we are doing a POST request on the /tasks endpoint. We are providing an object as per the documentation. This used to work until yesterday then it started triggering the error. We tried everything but can’t seem to figure out what stopped working.

We have also had the same error start occurring for our POST request on the /tasks endpoint which has been running for months - we already had GID formatted as string, have tried every variation I can think of but still getting the error.

“custom_fields”: {
“1109264714425215”: “1109264714425213”}

Open to any ideas for a fix!

2 Likes

@Ross_Grambo @Joe_Trollo any thoughts on these issues?

Hmmm. I believe changes were made recently, so that is likely the issue. I tried to reproduce this for the API team, but I’m unable to.

Does someone have reproducible steps?

I tried a PUT & POST on /tasks & /tasks/{gid} with text:

{
  "data": {
	"custom_fields": {
		"1234567890": "Some Text"
	},
	"name": "Text Test"
  }
}

And with enum:

{
  "data": {
	"custom_fields": {
		"0987654321": "234567890"
	},
	"name": "Enum Test"
  }
}

Is this approach different than what you’re all doing?

That is exactly what we are doing, and were doing before :).

Here’s the data that I’m sending:

{
  "projects": "634907411495814",
  "name": "test task",
  "custom_fields": { "1165055968449098": "test text" }
}

No matter what type of custom field, as soon as one is specified the error triggers. Note that we are indicating a project to add the task to.

EDIT

Our API team was able to reproduce the issue. They’re working towards a fix today.

2 Likes

The fix should be deployed tomorrow by 9am PST!

6 Likes

Thanks ! We’ll let you know when we tested it.

Hey Ross! Is the fix out? We’re still getting the same error message.

1 Like

Still getting the same error as well FYI;

We are still getting the same error also.