I'm trying to retrieve timesheet data (approved hours) along with some information about each entry. I'm getting nearly everything I want, but I can't figure out how to get the customer name(s) in the timesheet.
Here's what I got so far:
I send a POST request to https://api.clarizen.com/v2.0/services/data/entityQuery
The POST data is:
{
"typeName": "Timesheet",
"fields": [
"ReportedBy.Email",
"ReportedDate",
"Duration",
"Project.Name",
"WorkItem.Billable",
"WorkItem.Name"],
"orders": [
{
"fieldName": "ReportedDate",
"order": "Ascending"
}],
"where": {
"and": [
{
"leftExpression": {"fieldName": "State"},
"operator": "Equal",
"rightExpression": {"value": "Approved"}
},
{
"leftExpression": {"fieldName": "ReportedDate"},
"operator": "GreaterThanOrEqual",
"rightExpression": {"value": "2015-12-01"}
}
]
}
}
This works fine, but I'd like to get the customer names for each entry in the timesheet back as well. I could use multiple requests, but I'm hoping that's not necessary.
Here's the curl command if you want to test (replace the session id with your own):
curl -d '{ "typeName": "Timesheet", "fields": [ "ReportedBy.Email", "ReportedDate", "Duration", "Project.Name", "WorkItem.Billable", "WorkItem.Name"], "orders": [ { "fieldName": "ReportedDate", "order": "Ascending" }], "where": { "and": [ { "leftExpression": {"fieldName": "State"}, "operator": "Equal", "rightExpression": {"value": "Approved"} }, { "leftExpression": {"fieldName": "ReportedDate"}, "operator": "GreaterThanOrEqual", "rightExpression": {"value": "2015-12-01"} } ] } }' -H "Authorization: Session FOOBAR-FOOBAR-FOOBAR" https://api.clarizen.com/v2.0/services/data/entityQuery