[rt-users] RT3 Documentation

Mike Friedman mikef at ack.Berkeley.EDU
Thu Sep 30 12:15:43 EDT 2004


On Thu, 30 Sep 2004 at 18:22 (+0400), Ruslan U. Zakirov wrote:

> Start from external utils on
> http://wiki.bestpractical.com/index.cgi?Contributions

Ruslan,

Thanks for your suggestions.  They do, however, illustrate the very
problem I'm having, given the limited time available to me for reading
html source, or possibly dozens of different scripts, in order to learn
about every possible field I might eventually want to deal with.
(Incidentally, our use of RT here is heavily based on external perl
scripts, so I want to be in a position to write ones in the future without
having to find and study more samples every time I need to accomplish a
new function).

>>   Create a ticket
> html/Ticket/Create.html parse form and create new ticket
>>   Change a ticket's queue, status, etc.
> html/Ticket/ModifyPeople.html
>>   Merge tickets
> html/Ticket/ModifyLinks.html
>>   Find last date/time a ticket was updated (*)

Is there an easy way for me to view these html files?

> $Ticket->LastUpdated; # returns ISO formated date
> $Ticket->LastUpdatedObj; # return RT::Date obj.
>>   Search for a ticket with a particular subject line
> my $Tickets = RT::Tickets->new( $RT::SystemUser );
> $Tickets->Limit(FIELD => 'Subject', OPERATOR => 'LIKE', VALUE => 'Foo');
> print $Tickets->Count;

OK, those examples show how to do specific things.  But that's just it:
they're specific.  Suppose I want some variation. I'd still need to know
what other fields are available.  For example, in the last sample above,
you show how to display the Count, but what if I want to display the ID
and the contents of each subject line for each ticket found.  What are the
field names for those?

This is why I regret the absence of a simple API definition document that
I could use as reference whenever I need to accomplish a new function.

Even the perl 'housekeeping' that I see in various sample scripts, e.g.,

   use RT;
   use RT::Interface::CLI qw(CleanEnv);
   use RT::Ticket;

   CleanEnv();
   RT::LoadConfig();
   RT::Init();

must, it seems, be taken 'on faith'.  When are each of the above 'used'
modules needed? What do 'CleanEnv()', 'LoadConfig()' and 'Init()' actually
do?  Are they always necessary?

And, for example, if I see code like this:

   my $queue = new RT::Queue($RT::SystemUser);

I find myself wondering:  what is 'SystemUser'?  And isn't '$RT' (as
opposed to 'RT') a perl variable?  If so, where is it set?

These are just some questions that occur to me as I read the sample
scripts and try to understand the API, so that as I write new scripts of
my own I know what I'm doing.

Thanks again;  I do appreciate your hints.  But given the time I have to
convert my scripts for RT3 (and position myself to write additional
scripts later), I'm still leaning toward the use of the 'rt' command,
which at least appears to be fully documented.

Mike

------------------------------------------------------------------------------
Mike Friedman                             System and Network Security
mikef at ack.Berkeley.EDU                    2484 Shattuck Avenue
1-510-642-1410                            University of California at Berkeley
http://ack.Berkeley.EDU/~mikef            http://security.berkeley.edu
------------------------------------------------------------------------------



More information about the rt-users mailing list