zendesk / zendesk_api_client_php

Official Zendesk API v2 client library for PHP
340 stars 262 forks source link

Retrieve tickets requested by a user #222

Closed massreuy closed 8 years ago

massreuy commented 9 years ago

How to retrieve tickets requested by a specific user in Zendesk PHP API Client V2?

In previous version I used this way

$tickets = $client->users($requesterId)->tickets()->findAll()

But in V2 there is no method called tickets available in Zendesk\API\Resources\Core\Users.

There is no reference about it in upgrade guide.

joseconsador commented 9 years ago

Hi @massreuy If you're referring to end-user tickets you can do it this way:

$tickets = $client->users($requesterId)->requests()->findAll()

For agents though, we haven't covered that part yet. Thank you for notifying us and we'll be sure to discuss this in our coming meeting next week.

Alternatively, if you'd like to submit your own Pull Request, you may do so. We do appreciate them! https://github.com/zendesk/zendesk_api_client_php#note-on-patchespull-requests

Regards, Jose