REST API resolved date | Community
Skip to main content

REST API resolved date

  • January 29, 2019
  • 4 replies
  • 0 views

Hi,

I'm trying to count all resolved tickets for the past 14 days, and per day.

So in example, this data is what I want:

2018-01-14:  32
2018-01-15:  15
2018-01-16:  12
2018-01-17:  21
2018-01-18:  34
2018-01-19:  10
...

However, I'm stuck, both the `search` and `view` end-points don't expose the `solved_at` field. Also I can't search on `ticket_metric` or filter the `ticket_metric` end-point.

/api/v2/search.json?query=type:ticket status:solved solved>=2018-01-16 solved<=2018-01-29

 

https://developer.zendesk.com/rest_api/docs/support/views#list-tickets-from-a-view
https://developer.zendesk.com/rest_api/docs/support/search#list-search-results

How can I manage this? Do I really need to do 14 requests for a per day search? Seems like a real overkill to me...

Seems weird to me, that I may query on a solved date, but the solved date isn't exposed in the results...

Looking forward to your reply.

Gr. Tim

This topic has been closed for replies.

4 replies

  • January 30, 2019

Hi Tim,

How many days does a ticket need to be solved before it's closed?

 

This kinda worked for me 

/api/v2/search.json?page=1&query=type%3Aticket+status%3Asolved+updated>"2019-01-30T17:27:45Z"+order_by%3Aupdated_at+sort%3Adesc

 

Note, i picked an arbitrary date 


  • January 30, 2019

Hi Tim (and thanks McCabe!) -- yes, I can see how it can be seen as a disconnect between searching-on but not getting back that value.

Under the covers, the "solved_at" date is part of a ticket's related metric resource. You can retrieve it for a ticket using the /api/v2/tickets/{ID}/metrics API. Since this value is not directly part of the ticket object itself, it's not returned with those other APIs.

If you're doing a lot of data processing on tickets, the incremental API endpoints may also be helpful.

With all these "raw" API calls, it's up to you to collate related data and do grouping. Zendesk Insights is the product that avoids having to do this work yourself, but the Professional or Enterprise plan is needed. Hope this helps!


  • January 30, 2019

Wow, so many areas I didnt know about

/metrics 

/api/v2/ticket_metrics.json?page=1 very nice

also incremental!, so much data

 

Thanks Bryan!


  • February 15, 2019

Glad to help McCabe! I also had another post a while ago that gives a breakdown of differences between different metric API endpoints, as well as some additional helpful links -- check it out:

https://develop.zendesk.com/hc/en-us/community/posts/360004240468-Agent-Work-Time-not-in-Ticket-Metrics?page=1#community_comment_360002025487