최근 검색


최근 검색 없음

Get open ticket for user without using search API



2021년 9월 10일에 게시됨

Hi,

Is there anyway to implement getting opened tickets of an agent without using search API. I would like to use the sideload, but not succeeded yet.Looking for something similar to this:

t1  = client.tickets(include: [users: :open_ticket_count]).first
t1.assignee.open_ticket_count


Any help would be highly appreciated. Thank you!


0

1

댓글 1개

I am able to see the details using the 'assigned_tickets' method, but 'open_ticket_count' method is not accessible for user. This is what I am seeing now.

 total_assigned_tickets = ticket.assignee.assigned_tickets.count => 3020
 open_tickets_count = ticket.assignee.assigned_tickets.select {|a| a.status == "open" }.count => 100

But this count in 'open_tickets_count' received above does not match with:

client.search(query: "status:open assignee:294").count => 2900

Both the cases the assignee_id is same. Also when I tried to find specific groups ticket like:

 groups_count = ticket.assignee.assigned_tickets.select {|a| a.group_id == "12345" }.count => 100

It returned 100 here , but using search query:

 client.search(query: "group_id:12345 assignee:294").count => 3020


So I am assuming a kind of pagination is applied when I do the count using select query. Not sure. 

I am actually aiming for:

ticket.assignee.open_ticket_count

can anyone guide here. Thanks!







0


댓글을 남기려면 로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물