I have one test task in my project but it isn’t returning any results. I have tried PHP API version 10.0.0, 10.0.2 and the lastest. Still the same results. Is this because the account I am using is still using the trial?
Thanks for the reply. It just always returns a response with a count of zero no matter what I try and I know there are tasks in the project. Oh well, I will keep messing with it. Do I need to upgrade to premium to get this to work? I am planning on it anyway when the trial runs out.
I’m running into the same exact error; querying the API through PHP returns the same output as above, but querying via URL works as expected. Are there any updates to this?
It does actual work. I was just trying to inspect the returned response to figure out how to get the info I wanted. Docs aren’t too helpful on this. All you have to do is loop through the response and each iteration is a task object. For example:
$project_id = 'stringofprojectid'
$tasks = $this->client->tasks->getTasksForProject($project_id, [], ['limit' => 20])
foreach($tasks as $t) {
// Get Name.
$t->name
// Due Date.
$gid = $t->due_on
// Loop through custom fields.
foreach ($t->custom_fields as $k => $value) {
// Find custom field by id.
if ($value->gid == 'customfieldid') {
// Get display value.
$dis = $value->display_value;
}
}
}