Discussion

Ask a Question
Back to All

Pulling CustomFields from Inner Collections

Hello, I am making a small report and am struggling to receive the CustomFields information on an inner collection. In particular, I am looking reach the CustomFields collection for Time entries via the /Users endpoint.

It seems when I use something of this sort:

&include=[FirstName, Times[Spent,CustomFields]]

that I receive the CustomFields for the "Items" collection within "Times" object. In my case, this collection is always empty, and I am instead looking for the CustomFields on each particular Time item. I have had success in getting the correct information with a second API call, but I would like to receive all relevant information in a single call if at all possible. Any help would be much appreciated!

A small sample response:

{
"Items": [
{
"ResourceType": "User",
"Kind": "User",
"Id": 1,
"FirstName": "Administrator",
"Times": {
"Items": [
{
"ResourceType": "Time",
"Id": 215,
"Spent": 1,
"Assignable": {
"ResourceType": "Assignable",
"Id": 1670,
"Name": "Test story"
},
"User": {
"ResourceType": "User",
"Kind": "User"
}
},
{
"ResourceType": "Time",
"Id": 208,
"Spent": 2.1,
"Assignable": null,
"User": {
"ResourceType": "User",
"Kind": "User"
}
}
]
},
"CustomFields": []
},
{
"ResourceType": "User",
"Kind": "User",
"Id": 9,
"FirstName": "Tanya",
"Times": {
"Items": []
},
"CustomFields": []
}
]
}