[rt-users] list of scrips in a queue

Asif Iqbal vadud3 at gmail.com
Sun Feb 14 16:08:34 EST 2016


On Sat, Feb 13, 2016 at 5:08 PM, Asif Iqbal <vadud3 at gmail.com> wrote:

> Hi All,
>
> How do I get the list of scrips of a queue?
>
> Here is my snippet..
>
> my $queue = RT::Queue->new($CurrentUser);
> my $scrips = RT::Scrips->new($CurrentUser);
> my ($status, $msg) = $queue->Load( 'help' );
> my ($status, $msg) = $scrips->LimitToQueue( $queue->id );
> my @queuescrips = $scrips->Prepared;
>
> foreach my $scrip (@queuescrips) {
>    print $scrip->Description;
> }
>
>
I got it working...

my ($status, $msg) = $scrips->LimitToQueue( $queue->id );

while ( my $Scrip = $Scrips->Next()) {
   print $Scrip->Description;
   print "\n";
}




> When I run this I get the following error
>
> [Sat Feb 13 22:06:54 2016] [critical]: Can't call method "Description" on
> unblessed reference at /usr/local/sbin/test.pl line 24.
> (/opt/rt4/lib/RT.pm:400)
> Can't call method "Description" on unblessed reference at /usr/local/sbin/
> test.pl line 24.
>
>
> --
> Asif Iqbal
> PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
>
>


-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160214/655e564e/attachment.html>


More information about the rt-users mailing list