RT::Client::REST is /usr/bin/rt converted to a Perl module. I needed to implement some RT interactions from my application, but did not feel that invoking a shell command is appropriate. Thus, I took rt tool, written by Abhijit Menon-Sen, and converted it to an object-oriented Perl module.

This callback is to provide the HTTP client (based on LWP::UserAgent) with username and password for basic authentication. It takes the same arguments as get_basic_credentials() of LWP::UserAgent and returns username and password:

Create a new object of type $type and set initial parameters to %params. For a ticket object, 'text' parameter can be supplied to set the initial text of the ticket. Returns numeric ID of the new object. If numeric ID cannot be parsed from the response, RT::Client::REST::MalformedRTResponseException is thrown.

Type of the object transactions are associated wtih. Defaults to "ticket" (I do not think server-side supports anything else). This is designed with the eye on the future, as transactions are not just for tickets, but for other objects as well.

When an error occurs, this module will throw exceptions. I recommend using Error.pm's try{} mechanism to catch them, but you may also use simple eval{}. The former will give you flexibility to catch just the exceptions you want.

Beginning with version 0.14, methods edit() and show() only support operating on a single object. This is a conscious departure from semantics offered by the original tool, as I would like to have a precise behavior for exceptions. If you want to operate on a whole bunch of objects, please use a loop.

Original /usr/bin/rt was written by Abhijit Menon-Sen <ams@wiw.org>. rt was later converted to this module by Dmitri Tikhonov <dtikhonov@yahoo.com>. In January of 2008, Damien "dams" Krotkine <dams@cpan.org> joined as the project's co-maintainer. JLMARTIN has become co-maintainer as of March 2010.