lanej / zendesk2

Zendesk API V2 client using Cistern
http://lanej.io/zendesk2/
MIT License
25 stars 28 forks source link

next_page still broken #16

Closed seemantk closed 10 years ago

seemantk commented 11 years ago

Hi Josh,

This is a repeat of the last comment on #12, since that ticket is closed.

Hi Josh,

The url is now fetched. However, the returned results are of the entire set of tickets:

>> u = zendesk.users.search(email: 'anurag@hitfix.com').first
=> #<Zendesk2::Client::User:0x7faaaab56998 attributes={url:"https://engineyard.zendesk.com/api/v2/users/205426458.json",id:205426458,external_id:"8e8db720a51013c3f789ab5d96c9ba183505d03b",name:"Anurag Jain",alias:"",created_at:2012-04-25 18:16:53 UTC,updated_at:2012-12-29 06:05:08 UTC,active:true,verified:true,shared:false,locale_id:1,time_zone:"Pacific Time (US & Canada)",last_login_at:2012-12-29 06:05:08 UTC,email:"anurag@hitfix.com",phone:"",signature:"",details:"",notes:"",organization_id:20297761,role:"end-user",custom_role_id:nil,moderator:false,ticket_restriction:"requested",only_private_comments:false,tags:[],suspended:false,photo:nil}>
>> t = zendesk.tickets.search(organization_id: u.organization_id)
=> #<Zendesk2::Client::Tickets:0x7faaaabd2b60 attributes={count:145,next_page_link:"https://engineyard.zendesk.com/api/v2/search.json?page=2&query=%22organization_id%3A20297761+type%3Aticket%22",previous_page_link:nil}>
>> t2 = t.next_page
=> #<Zendesk2::Client::Tickets:0x7faaaab33308 attributes={count:53037,next_page_link:"https://engineyard.zendesk.com/api/v2/tickets.json?page=3&query=%22organization_id%3A20297761+type%3Aticket%22",previous_page_link:"https://engineyard.zendesk.com/api/v2/tickets.json?page=1&query=%22organization_id%3A20297761+type%3Aticket%22"}>

(Note the count: attribute in both search results)

Further, the actual ticket in the first page is accurate, but the actual ticket in the next_page is the actual first ticket ever filed, I think (https://support.cloud.engineyard.com/tickets/190 is a test one):

>> t[0]
=> #<Zendesk2::Client::Ticket:0x7faaaabd2a48 attributes={url:"https://engineyard.zendesk.com/api/v2/tickets/28792.json",id:28792,external_id:"",via:{"channel"=>"web", "source"=>{"from"=>{}, "to"=>{}, "rel"=>nil}},created_at:2011-09-01 17:03:47 UTC,updated_at:2011-10-02 08:27:21 UTC,type:"",subject:"solr connection keeps flaking",description:"Hi,\r\nOur application connects to the utilities server for solr search. This is an integral part of the process, and for some reason, it keeps failing periodically. If I kill the solr process, it restarts very soon thereafter, but soon just sits there, while connections to http://domU-12-31-39-01-C5-C1.compute-1.internal:8983/solr (internally) start timing out.\r\n\r\nThis is urgent because \r\n1. search functionality on our site is down\r\n2. our editors cannot publish anything.\r\n\r\nAny help here is greatly appreciated.\r\n\r\nThanks,\r\nAnu\r\n",priority:"urgent",status:"closed",recipient:"",requester_id:76644918,submitter_id:76644918,assignee_id:14523051,organization_id:20297761,group_id:20008808,collaborator_ids:[],forum_topic_id:nil,problem_id:nil,has_incidents:false,due_at:nil,tags:["cat_customer_education", "high", "prod_appcloud", "survey", "survey_notified", "this_took_over_an_hour_"],custom_fields:[{"id"=>20767583, "value"=>nil}, {"id"=>20012603, "value"=>"high"}, {"id"=>20011112, "value"=>"this_took_over_an_hour_"}, {"id"=>20013206, "value"=>"prod_appcloud"}, {"id"=>20957676, "value"=>nil}, {"id"=>22191568, "value"=>nil}, {"id"=>20407851, "value"=>nil}, {"id"=>20012528, "value"=>"cat_customer_education"}, {"id"=>20305226, "value"=>false}, {"id"=>20348056, "value"=>nil}, {"id"=>20212126, "value"=>false}, {"id"=>20348007, "value"=>nil}, {"id"=>20829523, "value"=>nil}, {"id"=>20936928, "value"=>nil}, {"id"=>20820013, "value"=>nil}, {"id"=>20820018, "value"=>nil}],satisfaction_rating:{"score"=>"good", "comment"=>""},sharing_agreement_ids:[]}>
>> t2[0]
=> #<Zendesk2::Client::Ticket:0x7faaaab28b88 attributes={url:"https://engineyard.zendesk.com/api/v2/tickets/191.json",id:191,external_id:"",via:{"channel"=>"web", "source"=>{"from"=>{}, "to"=>{}, "rel"=>nil}},created_at:2009-08-20 18:23:58 UTC,updated_at:2010-02-23 08:02:09 UTC,type:"question",subject:"Custom Chef Script",description:"Hello,\r\nI know that writing custom chef scripts is outside of the scope of Flex beta support.  How much would your professional services team charge to write a Chef script that I could use with the Flex EY deployment process to make the following changes to the server after boot:\r\n\r\n1) I've added the PHP package to my application's requirements, however, the default configuration of PHP has one parameter set to off in the default php.ini file.  I need a script to set allow_fopen_url permissions in php.ini file \r\n\r\n2) I need to set +w permissions on two directories.\r\n\r\nJust curious how much and how long this would take, so I can see if it's more cost-effective to have you assist with this rather than me researching how to build the scripts.\r\n\r\nThanks,\r\n\r\nRob\r\n\r\n",priority:"normal",status:"closed",recipient:"",requester_id:3299237,submitter_id:3299237,assignee_id:2532369,organization_id:36499,group_id:45544,collaborator_ids:[],forum_topic_id:nil,problem_id:nil,has_incidents:false,due_at:nil,tags:["audited", "billing_complete", "easy", "non-billable", "php"],custom_fields:[{"id"=>20767583, "value"=>nil}, {"id"=>20012603, "value"=>nil}, {"id"=>20011112, "value"=>nil}, {"id"=>20013206, "value"=>nil}, {"id"=>20957676, "value"=>nil}, {"id"=>22191568, "value"=>nil}, {"id"=>20407851, "value"=>nil}, {"id"=>20012528, "value"=>nil}, {"id"=>20305226, "value"=>nil}, {"id"=>20348056, "value"=>nil}, {"id"=>20212126, "value"=>nil}, {"id"=>20348007, "value"=>nil}, {"id"=>20829523, "value"=>nil}, {"id"=>20936928, "value"=>nil}, {"id"=>20820013, "value"=>nil}, {"id"=>20820018, "value"=>nil}],satisfaction_rating:nil,sharing_agreement_ids:[]}>
lanej commented 10 years ago

should be fixed by the cistern 0.5 bump