Re: [rt-users] Can a scrip do a search like RT::Client::REST does?

2013-06-13 Thread k...@rice.edu
On Thu, Jun 13, 2013 at 10:38:06AM -0700, Landon wrote:
 My scrip looks for currently open Incidents that are related to each of the
 IP addresses in CF.{IP} on an Incident Report.  If it finds one it links
 the Incident Report to that Incident thus making it unnecessary for someone
 to do it manually later.  This might be changed to CustomerID or something
 later.
 
 Anyway - The snippet from my scrip that I'd like to modify with something
 more native instead of using RT::Client::REST is the following.  Is there a
 way to search for tickets without using RT::Client::REST?  I've been
 reading through page after page but I'm not able to figure this one out.
  Is this the only way I'll be able to do it?  It works but it logs itself
 in to RT via the web interface each time a new Incident Report comes in.
 
 use RT::Client::REST;
 ...

Hi Landon,

I think you should be able to use RT::Search from your scrip directly.
Check out the API docs.

Cheers,
Ken


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training


Re: [rt-users] Can a scrip do a search like RT::Client::REST does?

2013-06-13 Thread Landon
On 13 June 2013 10:44, k...@rice.edu k...@rice.edu wrote:


 Hi Landon,

 I think you should be able to use RT::Search from your scrip directly.
 Check out the API docs.


Thanks Ken.  The document I found was at
http://bestpractical.com/rt/docs/4.0/RT/Search.html

I don't know how to specify the query though…  Maybe I'm looking at this
wrong?  I'm not really clear on what $arg is for here either.  I thought it
was a parameter, like maybe where one would specify the query, but in the
information below under Argument it says it returns the optional argument
associated with the search.  I find most of the documentation for the API
confusing like this actually.

-- 
Landon Stewart landonstew...@gmail.com


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training