It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Populating custom fields via. API Edited

I'm having some trouble populating a custom field on a card via. the API. The URL I am using is: 

https://api.trello.com/1/card/{CardID}/customField/{CustomFieldID}/item?key={Key}&token={Token}

The response I'm getting when making the request is a 400 code, and the response body is: 

Invalid value for custom field type

The data that is being sent in the PUT request is: 

{ "value" : { "text": "Hello, world!" }}

Is there anything obvious that I'm doing wrong here? Would you be able to point me in the right directiion? The custom field is of type: text, so I'm at a loss.

1 answer

0 votes
Marc Community Leader Oct 19, 2018

@Mikeres0What seems wrong to me is the url / path for cards, you use:

https://api.trello.com/1/card/{CardID}/ ......

whereas it should be:

https://api.trello.com/1/cards/{CardID}/ ......

i.e. cards

So there seems to be an error in the Trello docs!.

ping for @Bentley Cook and @torben

Bentley Cook Atlassian Team Oct 19, 2018

All of the endpoints accept both singular and plural nouns in the route, so I don't think that is the problem.

That error message leads me to believe that you're trying to update a Custom Field that has a type other than text (dropdown, number, etc.). Can you confirm that it is a text type Custom Field?

If it is a text Custom Field, then I'd guess that something might be up with the body. Here is a Postman collection that includes a single PUT request that works to update a Custom Field: https://www.getpostman.com/collections/e82e59d6d5ba6e41f485

Marc Community Leader Oct 21, 2018

@Bentley Cook

All of the endpoints accept both singular and plural nouns in the route, so I don't think that is the problem.

Is that documented somewhere?  Could not find this in the API reference.

Marc Community Leader Oct 22, 2018 • edited

:100

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Trello

There's a lot to love about the next evolution of Trello Community

Hi, team, Whether you've been hanging out here in the Trello collection for awhile, or whether you're just now joining us from the Trello Slack Community, we’ve got some exciting news about th...

2,282 views 23 46
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you