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 and @torben

bentley 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

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.

bentley Atlassian Team Oct 22, 2018
marc Community Leader Oct 22, 2018 • edited

:100

Suggest an answer

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

Using Trello to plot a NaNoWriMo novel, Save the Cat! Style

I’m a big fan of writing, tools, and writing tools. So as National Novel Writing Month (an annual 30-day challenge to write a 50,000-word novel) appeared on the horizon, I decided to use two of my fa...

400 views 5 8
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