[rt-users] Getting started with scrips...

Francois Meehan fmml at cedval.org
Wed Sep 21 12:37:23 EDT 2005


Thanks Joby,

Got it to work now. pls humbly excuse my perl-RT newbiness...

Best regards,

Francois

> -----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-----
>



Random Thought:
---------------
Life is real! Life is earnest!And the grave is not its goal;Dust thou art, to dust returnest,Was not spoken of the soul. - Henry Wadsworth Longfellow, 1807 - 1882



More information about the rt-users mailing list