List of scrips in a queue

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

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?

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?