[rt-users] Surveys

Stephen Turner sturner at MIT.EDU
Wed May 23 13:47:20 EDT 2007


At Wednesday 5/23/2007 12:58 PM, José de Paula Eufrásio Júnior wrote:
>Can you share your scrip for me to use it as a starting point? :)
>
>[]s
>core

Hi Jose,

Sure - the scrip is

Condition - user defined (see code below)
Action - notify requestor
Template - survey email (contains a link to the survey page)

The Custom condition code is:


# Only deal with Resolve transactions:
return 0 unless $self->TransactionObj->Type eq "Status"
              && $self->TransactionObj->NewValue eq "resolved";

my $ticket = $self->TicketObj;

my $trans_list = $self->TicketObj->Transactions;
my $trans;
my $num_resolved = 0;

while ($trans = $trans_list->Next)
{
     $num_resolved++ if ($trans->Ticket == $self->TicketObj->Id) &&
         ($trans->Type eq "Status") &&
         ($trans->NewValue eq "resolved");
}

# Only send mail the first time a ticket is resolved:
return 0 if $num_resolved > 1;

return 1;



Stephen Turner
Senior Programmer/Analyst - Client Support Services
MIT Information Services and Technology (IS&T)





More information about the rt-users mailing list