[rt-users] Scrips issue

Ramon Kagan rkagan at yorku.ca
Thu Jun 2 09:00:51 EDT 2005


HI,

I think your problem is your condition.  It's not "On Create" that you
want.  As far as I can tell you're not creating a new ticket.  You
probably want "On Correspond" or "On Comment" depending on how you setup
the alias.

Ramon Kagan, GCIA
York University, Computing and Network Services
Information Security  -  Senior Information Security Analyst
(416)736-2100 #20263
rkagan at yorku.ca

-----------------------------------   ------------------------------------
I have not failed.  I have just	       I don't know the secret to success,
found 10,000 ways that don't work.     but the secret to failure is
				       trying to please everybody.
	- Thomas Edison				- Bill Cosby
-----------------------------------   ------------------------------------

On Thu, 2 Jun 2005, Luiz Henrique Ozaki wrote:

> -----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-----
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
>
>



More information about the rt-users mailing list