[rt-users] Condition error

Leon rt at tux.datalink.co.za
Thu Feb 16 07:34:14 EST 2006

I have used the Reply to resolved ticket condition from the wiki 
contribution page and I can’t get it to work.

I have found an old post where someone tried to copy the Base.pm and 
Generic.pm to the Local folders and that worked for them ( not for me), 
I tried copying the ReplyToResolvedTicket.pm to the lib folder, but it 
also didn’t work.

It looks like it can’t create an object of type ReplyToResolvedTicket 
for some reason, but I am not sure if this is the case or why. Any help 
would really be appreciated.

I get the following errors:

[Thu Feb 16 11:51:30 2006] [error]: Scrip IsApplicable 15 died. - Can't 
locate object method "new" via package 
"RT::Condition::ReplyToResolvedTicket" at 
/opt/rt3/lib/RT/ScripCondition_Overlay.pm line 181.


Here is the ReplyToResolvedTicket.pm file, that is located in
package RT::Condition::ReplyToResolved;
require RT::Condition::Generic;

use strict;
use vars qw/@ISA/;
@ISA = qw(RT::Condition::Generic);

##use base qw(RT::Condition::Generic); # thanks Ruslan for the suggestion

sub IsApplicable {
     my $self = shift;
     my $ticket = $self->TicketObj;
     my $transaction = $self->TransactionObj;
     if ((($transaction->Type eq 'Correspond') || ($transaction->Type eq 
'Comment')) && $ticket->Status eq 'resolved' && $transaction->Creator != 1)
     { # prevent loop
     else {
eval "require RT::Condition::ReplyToResolvedTicket_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate 
eval "require RT::Condition::ReplyToResolved_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate 

Here is the script that I used to add the condition to the database:
use strict;
use Unicode::String qw(utf8 latin1);

# Replace this with your RT_LIB_PATH
use lib "/opt/rt3/lib";

# Replace this with your RT_ETC_PATH
use lib "/opt/rt3/etc";

use RT;
use RT::Interface::CLI qw( CleanEnv GetCurrentUser );
use RT::ScripCondition;

##Drop setgid permissions
##Get the current user all loaded
our $CurrentUser = GetCurrentUser();

unless( $CurrentUser->Id ) {
    print "No RT user found. Please consult your RT administrator.\n";
    exit 1;
my $sc = new RT::ScripCondition($CurrentUser);

             Name                 => 'On Reply to Resolved Ticket',
             Description          => "On Reply to Resolved Ticket",
             ExecModule           => 'ReplyToResolvedTicket',
             ApplicableTransTypes => 'Any'

This is the scrip that I added to RT to test with:
Desc: ReplyToResolved
Condition: On Reply to Resolved Ticket
Action: Userdefined
Template: Global Template: Blank

Custom action Prepration code: 1;
Custom action cleanup code: 1;

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the rt-users mailing list