The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello, we have a power-up app on trello; however, we cannot get values of custom fields that are with type of "dropdown". Is there any way to retrieve?
API URL: GET https://api.trello.com/1/board/607eb929ee33c047e810692f/cards?customFieldItems=true&fields=name&key={key}&token={token}
Response:
Hello @Turan Gurler
In the response from the REST API, for the dropdown custom fields, it will only tell you the ID of the option that's been selected for that field:
{
"id": "60cd9a5dc324113a527ad8ff",
"idValue": "60cd97c3199236728d9cf992", <- The id of the option selected
"idCustomField": "60cd9792d094da669588de05", <- The id of the field
"idModel": "607e32a184fead458a199e07",
"modelType": "card"
}
To translate that ID value back into what that option contains (IE the text and the color) you have to query the Get a Custom Field endpoint using the ID of that dropdown custom field:
GET https://api.trello.com/1/customFields/60cd9792d094da669588de05?key={key}&token={token}
...and you will get back something like the following:
{
"id": "60cd9792d094da669588de05", <- The id of the field
"idModel": "602786e91c69d30e45a9ccd8",
"modelType": "board",
"fieldGroup": "bba6783271ae2131251b190534817d1ccadd217b2267540b434cbdaf417866c9",
"display": {
"cardFront": true
},
"name": "Dropdown choices",
"pos": 49152,
"options": [
{
"id": "60cd97c3199236728d9cf992", <- The id of the option
"idCustomField": "60cd9792d094da669588de05", <- The id of the field, again
"value": {
"text": "Green option" <- The text for that option
},
"color": "green", <- The color for that option
"pos": 16384 <- The position of that option within the field (the order)
},
{
"id": "60cd97c791d7b954b63dbaeb",
"idCustomField": "60cd9792d094da669588de05",
"value": {
"text": "Red option"
},
"color": "red",
"pos": 32768
}
],
"type": "list",
"limits": {
"customFieldOptions": {
"perField": {
"status": "ok",
"disableAt": 50,
"warnAt": 45
}
}
},
"isSuggestedField": false
}
From these two pieces of data, it's now known that the dropdown custom field called 'Dropdown choices' on a particular card has been set to the value 'Green option' and that option has the color 'green'.
The reason for this two-step approach is that the options available for the dropdown custom fields are stored at the board level, not the card level, so you have to query at the next level up, so to speak, to find what those options are, then correlate them to which one has been chosen for a particular card.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I never used API, but I do access the JSON file through Power BI. I believe the problem here is that you're accessing the "Cards" section of the database. This will bring the value set for the cards.
Instead, you should be going for the "customFields" portion of the database. Through that, you will be able to get all the data related to Custom Fields per se, like which fields you havem their ids, types, and 'Options', which is what you are looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Congratulations to @Laura Holton , our latest winner of Taco Tuesday! And thanks to @Kristján Geir Mathiesen for sharing the picture of Taco having fun with his new friend B...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.