[rt-users] Scrip for replying to a resolved ticket, scrip results

Gene LeDuc gleduc at mail.sdsu.edu
Wed Apr 21 11:53:43 EDT 2010


Hi Evan,

On 4/21/2010 8:02 AM, Lucchesi Leon, Evan wrote:
> Hi all, two questions that I haven't been able to find answers to after
> a few hours of searching and reading through code:
>
> (For reference I use RT 3.8.4 right now)
>
> 1) I'd like to set up a scrip that will correspond with a template when
> someone replies to a ticket that has been resolved. I have tried a
> number of different things to try and only send the reply to the person
> who sent the correspondence, but I gave up and decided I'd be happy if
> it would just autoreply to all requestors and CCs with my template when
> someone replies to it and it's resolved. So the most recent scrip I have
> tried is the simplest, and doesn't seem to do anything. Can anyone tell
> me what I'm doing wrong?
>
> Condition: User Defined
> Action: Autoreply to Requestors and Ccs
> Template: Global template: Autoreply to Resolved
> Stage: TransactionCreate
>
> Custom Condition:
> return 0 unless ($self->TransactionObj->Type eq "Correspond" &&
> $self->TicketObj->Status eq "Resolved");
> return 1;

I don't know whether it matters, but I always use lowercase for 
TicketObj->Status because that's how it's stored in the database (in 
3.6.3).  I have a similar scrip (but with additional conditions) and it 
works using "Correspond" and "resolved".

If changing the case doesn't work, putting $RT::Logger->debug("Myscrip 
Status=" . $self->TicketObj->Status . ", Type=" . 
$self->TransactionObj->Type) as your first line might help you figure 
out what is going on.

Gene



More information about the rt-users mailing list