[rt-users] Getting started with scrips...
Joby Walker
joby at u.washington.edu
Wed Sep 21 11:37:47 EDT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
There are very few variables that are available to you in a Scrip.
%session is not one of them.
Francois Meehan wrote:
> # init empty instance of RT::Ticket class
> my $TicketObj = RT::Ticket->new( $session{'CurrentUser'} );
This doesn't select the current Ticket. If it worked (which it doesn't
in a scrip) it would create a new Ticket object -- from there you would
have to load a ticket number. In a Scrip you can easily get the current
ticket:
my $TicketObj = $self->TicketObj;
> my $TargetQueueName = 'nagios';
> my ($status, $msg) = $TicketObj->SetQueue( $TargetQueueName );
> unless( $status ) {
> die "Error: $msg";
> }
>
Look at some of the examples at:
http://wiki.bestpractical.com/index.cgi?Contributions
jbw
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDMX5LgA0gpghkf88RAkPEAJsGcLiobMlyAFSOBIuphMPNL/PeRACguvGm
c1LTy1ggh/EoTAZkmMMhjtE=
=RsDe
-----END PGP SIGNATURE-----
More information about the rt-users
mailing list