<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Scrip for replying to a resolved ticket, scrip results</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi all, two questions that I haven't been able to find answers to after a few hours of searching and reading through code:</FONT></P>

<P><FONT SIZE=2 FACE="Arial">(For reference I use RT 3.8.4 right now)</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">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?</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Condition: User Defined</FONT>

<BR><FONT SIZE=2 FACE="Arial">Action: Autoreply to Requestors and Ccs</FONT>

<BR><FONT SIZE=2 FACE="Arial">Template: Global template: Autoreply to Resolved</FONT>

<BR><FONT SIZE=2 FACE="Arial">Stage: TransactionCreate</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Custom Condition:</FONT>

<BR><FONT SIZE=2 FACE="Arial">return 0 unless ($self->TransactionObj->Type eq "Correspond" && $self->TicketObj->Status eq "Resolved");</FONT>

<BR><FONT SIZE=2 FACE="Arial">return 1;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">2) We have a number of custom scrips in our RT installation, many of which perform transactions themselves - for example, when a ticket's queue is changed from A to B, make sure X and Y custom fields are set, if they aren't, put the ticket back in A.  The actual line to move the ticket back is</FONT></P>

<P><FONT SIZE=2 FACE="Arial">my ($retcode, $msg) = $self->TicketObj->SetQueue($original_queue);</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">The problem is, when you go to actually move the ticket to B, and it gets moved back to A by the scrip, the "Results" section at the top of the page only displays that it moved the ticket from A to B, and without looking at the queue you'd have no idea that it was automatically moved back for you.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">So is it possible to either</FONT>

<BR><FONT SIZE=2 FACE="Arial">- Rewrite my line of code above to record the standard "Ticket moved from A to B" message in the Results section, or</FONT>

<BR><FONT SIZE=2 FACE="Arial">- (preferred) Inject arbitrary text in to this Results box so I can add my own explanation to the user as to what happened and why?</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Thanks for your time, let me know if I can provide any more information on any of this.</FONT>
<BR>

<BR><FONT SIZE=2 FACE="Arial">Evan</FONT>
</P>

<pre>


This email (including any attachments) is for its intended-recipient's
use only. This email may contain information that is confidential or
privileged.  If you received this email in error, please immediately
advise the sender by replying to this email and then delete this message
from your system.  For further information and disclaimers that apply to
this email, see [http://www.viacom.com/termsofuse/Pages/default.aspx].
</pre></BODY>
</HTML>