Craig Brass Systems Forum: Date range search on getSubmittedTickets - Craig Brass Systems Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Date range search on getSubmittedTickets

#1
User is offline   moosarka 

  • Member
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 24-November 08
Andrew,

What are your thoughts on implementing a created on date (to, from) filter search on getSubmittedTickets API? For instance, we would like to know how how many tickets client(s) submitted within a duration of time. With this functionality, we can extend the API to analysis and reporting.

Great API, thanks for sharing.
0

#2
User is offline   Andrew Gillard 

  • Staff - Lead Developer
  • Pip
  • Group: Developers
  • Posts: 97
  • Joined: 04-March 07
  • Gender:Male
  • Location:Basingstoke, United Kingdom
Try the attached files, both of which replace the files of the same name in /integrationapi/lib/. The attached api.class.php includes the changes that I made for your reported bugs.

You can now specify a minimum & maximum ticket creation (start) date, a minimum & maximum last activity date, a minimum & maximum due date, a specific department, a specific status and a specific priority. If the requested department, status or priority is left at 0, that parameter will be ignored and all departments/statuses/priorities will be returned (i.e. keeping to the old behaviour).

Additionally, this function will now include the start (creation) date and due date in the returned array.

Again, if these changes work for you I'll release it all as a new API version.

Note that the parameters passed to getSubmittedTickets() and the array returned by that function have changed. If you're using SOAP, you'll need to change the way you call that function (if you're calling it directly in PHP, you can leave those parameters out and it'll take the defaults; the changes to the returned array can be ignored if you don't need any of the additional information).

Take a look at our documentation thread for more information smile.gif

Attached File(s)


Andrew Gillard
Lead Developer - Craig Brass Systems
0

#3
User is offline   moosarka 

  • Member
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 24-November 08
QUOTE (Andrew Gillard @ Nov 26 2008, 08:50 AM) <{POST_SNAPBACK}>
Try the attached files, both of which replace the files of the same name in /integrationapi/lib/. The attached api.class.php includes the changes that I made for your reported bugs.

You can now specify a minimum & maximum ticket creation (start) date, a minimum & maximum last activity date, a minimum & maximum due date, a specific department, a specific status and a specific priority. If the requested department, status or priority is left at 0, that parameter will be ignored and all departments/statuses/priorities will be returned (i.e. keeping to the old behaviour).

Additionally, this function will now include the start (creation) date and due date in the returned array.

Again, if these changes work for you I'll release it all as a new API version.

Note that the parameters passed to getSubmittedTickets() and the array returned by that function have changed. If you're using SOAP, you'll need to change the way you call that function (if you're calling it directly in PHP, you can leave those parameters out and it'll take the defaults; the changes to the returned array can be ignored if you don't need any of the additional information).

Take a look at our documentation thread for more information smile.gif



Alright, those are great enhancements Andrew. I'll give that a spin and keep you posted.
0

#4
User is offline   moosarka 

  • Member
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 24-November 08
Changes works for me. Thanks Andrew.

Andrew, let me know your thoughts on this from your API perspective.

From a business point of view, I would like to have a list of all issues that belong to a client? A client is a group by which you can have one or more named e-mail users. In Kayako, if you make a user a manager, he/she can see all the tickets that belong to other users in that group. What's the best way to get the list of clients that belong in a group? So far, I've had to maintain an array and loop through elements in the array to extract e-mail addresses. In that case, it depends on my part to keep a list of e-mail addresses in the array. Do you see a better way of extracting all e-mails from a group using your API, and passing that info to the getSubmittedTickets function? Would be nice to have it dynamic.

Thanks.
0

#5
User is offline   moosarka 

  • Member
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 24-November 08
Maybe if there was a function in the API to get a list of all users (i.e., their email) that belong to a group, we can iterate through the results and push back to getSubmittedTickets function. This should give us a list of all tickets for a group.

Thanks.
0

#6
User is offline   Craig Brass 

  • Staff - Managing Director and Chief Software Architect
  • PipPipPip
  • Group: Management
  • Posts: 349
  • Joined: 17-January 07
This really goes beyond what this API was designed for. If you wish to PM me however, we could do some custom development work (paid) for you if your interested.
Craig Brass
Managing Director and Chief Software Architect - Craig Brass Systems
0

#7
User is offline   moosarka 

  • Member
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 24-November 08
Craig,

I believe that's fair. I will PM you shortly for a quote.

Thanks.


0

#8
User is offline   Craig Brass 

  • Staff - Managing Director and Chief Software Architect
  • PipPipPip
  • Group: Management
  • Posts: 349
  • Joined: 17-January 07
Got the PM. Will reply some time today.
Craig Brass
Managing Director and Chief Software Architect - Craig Brass Systems
0

#9
User is offline   Andrew Gillard 

  • Staff - Lead Developer
  • Pip
  • Group: Developers
  • Posts: 97
  • Joined: 04-March 07
  • Gender:Male
  • Location:Basingstoke, United Kingdom
I've now released this as 1.0.2, along with another bug fix, however because SOAP cannot support default parameter values and I didn't want to break the existing interface, I've had to add a new function that does what you requested above: getSubmittedTicketsWithExtraRestrictions(). Once you update to the latest version of the API, just replace your call(s) to getSubmittedTickets() with getSubmittedTicketsWithExtraRestrictions() and everything will work properly again.

Sorry to mess you about like that, but I had to choose between requiring just you to change your client code, and requiring everyone to update their client code; hopefully you can see why I chose what I did smile.gif

Internally, getSubmittedTickets() was renamed to getSubmtitedTicketsWithExtraRestrictions(), and a new getSubmittedTickets() function was created that simply calls getSubmittedTicketsWithExtraRestrictions(), passing a few default parameters for the new parameters.
Andrew Gillard
Lead Developer - Craig Brass Systems
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users