[rt-users] Scrips issue

Luiz Henrique Ozaki luiz at eaprender.com.br
Thu Jun 2 08:55:25 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Im trying to make a scrips where if there is a string 'fechar' in the
subject of the mail, it closes the coresponding ticket.

Here goes:
Description: AutoClose on e-mail reply
Condition: On Create
Action: User Defined
Template: Blank
Stage: TransactionCreate

Custom condition:

Custom action preparation code:
1;

Custom action cleanup code:
my $problem_desc = undef;

my $Transaction = $self->TransactionObj;
my $subject = $Transaction->Attachments->First->GetHeader('Subject');
if ($subject =~ m/fechar/) {
    $problem_desc = $2;

    $RT::Logger->debug("Usuario aprovou a solucao: $problem_desc");
} else {
    return 1;
}

my $TicketsObj = RT::Tickets->new($RT::SystemUser);
$search->LimitStatus(VALUE => 'new', OPERATOR => '=', ENTRYAGGREGATOR
=> 'or');
$search->LimitStatus(VALUE => 'open', OPERATOR => '=');

if ($search->Count == 0) { return 1; }
my $id = undef;
while (my $ticket = $search->Next) {

  next if $self->TicketObj->Id == $ticket->Id;
  $id = $ticket->Id;
  last;
}

$id || return 1;
$self->TicketObj->SetStatus( "resolved" );
1;

But it isnt working. Can anybody help me ???

Regards,

- --
[]'s
Luiz Henrique Ozaki <luiz at eaprender.com.br>
0xC842A83F KEYID



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
 
iD8DBQFCnwG9w2cLyMhCqD8RAvQCAJ9tO1oY7PQ+8FHRKSM9i7019kkH3QCeIz8u
Oh+ReH375WC2NO/HX+LU/6E=
=GF8U
-----END PGP SIGNATURE-----




More information about the rt-users mailing list