Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Getting custom fields for given cards on Trello via REST API

Alex Nim I'm New Here Sep 14, 2020

Hi,

 

I'm trying to build a dashboard using data related to a board and it's lists, cards and custom fields. 

 

I have successfully retrieved the board, lists and cards data via REST API. However, I've come across a few problems when trying to get custom fields data. Mainly because the custom fields data does not contain any information to indicate which card it belongs to.  

 

I've been trying to get the custom fields for cards on a Trello board via REST API.

 

https://developer.atlassian.com/cloud/trello/rest/api-group-actions/#api-actions-id-card-get

 

So I've been creating a JDBC connection using a URL created by following the documentation from the link above. 

 

However, this returns a list of all the custom fields in the board, but it does not contain any data that will allow me to join with data related to the cards in the board. 

 

Does anyone know how I can get the kind of data related to custom fields that I'm looking for? Thanks! 

2 answers

@Alex Nim  What you have gotten are the definitions. You need to get custom field items from card.  

Get Custom Field Items for a Card

GET /1/cards/{id}/customFieldItems

Get the custom field items for a card.

Alex Nim I'm New Here Sep 15, 2020

hi, thanks for replying

 

I'm trying to get the custom fields for all cards - without having to create a URL for each and every card on the board.

 

I've used the following URL: 

https://api.trello.com/1/boards/{BOARD_ID}/cards/?fields=all&customFieldItems=true

 

This appears to get all the custom fields in the board, but does not contain data that identifies the card it belongs to.

 

I want to join all the custom fields with their corresponding cards. perhaps I'm using the wrong definitions? thanks 

@Alex Nim  I have been using a python wrapper for Trello API. To get the card CF you need to fetch each card then get each CF. And when you want to update or add a CF you need the CF definition (object) for that CF because the definition will define, amongst other things, the type_field like number, list, date...etc. 

The definitions are defined at the board level. 

Like Iain Dooley likes this
0 votes
Iain Dooley Community Leader Sep 15, 2020

@Alex Nim the custom fields API is a bit of a labyrinth. You can see my complete implementation if you start from here:

https://github.com/iaindooley/trellinator-libs/blob/master/Card.js#L1306

Basically you get a list of custom field definitions for the board, then you use the IDs to get individual values on a per card basis.

Suggest an answer

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

📹 What is Trello?

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. I'll be sharing with you a series of videos with my top tips on how to best use Trello...

774 views 13 30
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