I need to get Custom Field values that are set on cards for my board. When I request the Custom Fields the values of some of the fields come back with a null value.
[
{
“id”: “677efba65af7bbe6dd8bf0c0”,
“value”: null,
“idValue”: “677d943ad9abc05c6802d65d”,
“idCustomField”: “677d943ad9abc05c6802d65a”,
“idModel”: “677d92a8779b0cb620274d3e”,
“modelType”: “card”
},
{
“id”: “677efba821f71a01b3b4e543”,
“value”: null,
“idValue”: “677d941b39e4d179b4b54a09”,
“idCustomField”: “677d941b39e4d179b4b54a04”,
“idModel”: “677d92a8779b0cb620274d3e”,
“modelType”: “card”
},
{
“id”: “677efbb582d6fd9fe5da8090”,
“value”: {
“text”: “https://support.naphcare.com”
},
“idValue”: null,
“idCustomField”: “677d938f9e5953f025c83144”,
“idModel”: “677d92a8779b0cb620274d3e”,
“modelType”: “card”
},
{
“id”: “677efba2341ca346db9c3c49”,
“value”: {
“number”: “4”
},
“idValue”: null,
“idCustomField”: “677d9376c47aae84772cb252”,
“idModel”: “677d92a8779b0cb620274d3e”,
“modelType”: “card”
},
{
“id”: “677efbab32e7c1e57ddd24bb”,
“value”: null,
“idValue”: “677d935fa8ab0899e85df02a”,
“idCustomField”: “677d935fa8ab0899e85df028”,
“idModel”: “677d92a8779b0cb620274d3e”,
“modelType”: “card”
},
{
“id”: “677efba96a7c16774e997fb9”,
“value”: null,
“idValue”: “677c13ac7a1f0e483d686f47”,
“idCustomField”: “677c13ac7a1f0e483d686f45”,
“idModel”: “677d92a8779b0cb620274d3e”,
“modelType”: “card”
}
]
Hello @DevinSanders
You’ll need to provide some information as to how you made that request (what language / toolset / libraries etc), which specific API endpoint was used and what request parameters were provided, what verification testing you’ve done outside your dev environment with an API test tool, what documentation you’ve referenced and the different methods you’ve used to try and resolve the problem yourself etc etc.
Refer to the How to ask a good question thread for reference.
I am using the PostMan collection provided here: Get Started Building on Trello. I have also tried this in C# using a HttpClient to make the API call. The endpoints with issues are /cards/{id} and /cards/{id}/customFieldItems
Custom fields with type Text and Number return a value. This only seems to impact fields with a Dropdown field type. As indicated in my examples the other json properties are included but “value” is null, since this is an issue on the Trello side there does not appear to be anything that I can do on my side to solve the problem.
Yes, the affected drop-down fields have a value when using the GUI. The fields that do not have a value are not included at all in the JSON response, which is expected.
OK, you’ve just mis-understood how drop-down custom fields return which of their options has been selected. They return the ID of the option that has been selected via the idValue
object, not the value
(the text or color) of that option.
You need to perform an additional lookup if you want to know what that option’s text and color is.
Refer to this thread on the public Atlassian Community forum where I’ve described the whole thing.
This is extremely helpful, thank you so much! This needs to be included in the official API documentation for custom fields.
Yep. Feel free to create a bug / feature request in the Trello wishing well in JAC.
The documentation for the Get custom field items endpoint makes no mention of the existence of the idValue
object at all, or the reason why its value can be null.
Equally as bad, it says the value
object only returns checked (true or false), which of course isn’t correct for number, text and date field types, or the reason why its value can be null (when the field is a drop-down type).