<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3157" name=GENERATOR><!-- converted from rtf -->
<STYLE>.EmailQuote {
PADDING-LEFT: 4pt; MARGIN-LEFT: 1pt; BORDER-LEFT: #800000 2px solid
}
</STYLE>
</HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009>After realizing my scrip was indeed being called
(although not obvious from the original logs) I turned to the
template.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009>With the following template, it all
works. </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=788222915-15092009>Note,
the ===Create-Ticket: line, and the ENDOFCONTENT lines are important, and the
order of the lines seems to matter somewhat - IE, in the order shown on the
RT-ESSENTIALS book, it wouldn't work for me... Also, note that the Owner
line refers to the ID of the owner, which may not be the email of the owner,
depending on your system. </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009>Template:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009>===Create-Ticket: manager-approval<BR>Subject: Approval
of {$Tickets{'TOP'}->Subject}<BR>Depended-On-By: TOP<BR>Queue:
___Approvals<BR>Type: approval<BR>Owner: SLANDER<BR>Refers-To:
{$Tickets{'TOP'}->Id()}</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009>Content : Please review and approve this
request.<BR>ENDOFCONTENT</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=788222915-15092009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Lander, Scott <BR><B>Sent:</B> Tuesday,
September 15, 2009 7:52 AM<BR><B>To:</B> Lander, Scott;
'rt-users@lists.bestpractical.com'<BR><B>Subject:</B> RE: Problem calling a
custom scrip - Update, but, still stuck.<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=397224211-15092009><FONT face=Arial
color=#0000ff size=2>I changed my scrip to be:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=397224211-15092009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV dir=ltr align=left><SPAN class=397224211-15092009><FONT face=Arial
color=#0000ff size=2>if ($self->TransactionObj->Type ne "Create")
{<BR> $RT::Logger->info( "> Not a Create \n"
);<BR> return 0; # This is an update
transaction<BR>}<BR> <BR>my $ticket = $self->TicketObj;<BR>my
$CustomFields =
$ticket->QueueObj->TicketCustomFields();</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=397224211-15092009><FONT face=Arial
color=#0000ff size=2>while (my $CustomField = $CustomFields->Next())
{<BR> my $nam = $CustomField->Name;<BR>
my $val =
$self->TicketObj->FirstCustomFieldValue($nam);<BR>
$RT::Logger->info( "> CustomField Name: $nam \n"
);<BR> $RT::Logger->info( "> CustomField Value:
$val \n" );</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=397224211-15092009><FONT face=Arial
color=#0000ff size=2> if ($val =~
/YES/){<BR> $RT::Logger->info(
"> This is a change control \n"
);<BR> return
1;<BR> }<BR>}</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=397224211-15092009><FONT face=Arial
color=#0000ff size=2>$RT::Logger->info( "> Default 0 exit \n"
);<BR>return 0;</FONT></SPAN></DIV><SPAN class=397224211-15092009><FONT
face=Arial color=#0000ff size=2></FONT></SPAN></BLOCKQUOTE>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV></BLOCKQUOTE>
<DIV dir=ltr><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2>And, now I see in the logs;</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2>[Tue Sep 15 04:34:13 2009] [info]: > CustomField Name:
Business Unit ((eval 1579):12)<BR>[Tue Sep 15 04:34:13 2009] [info]:
> CustomField Value: Charlotte ((eval 1579):13)<BR>[Tue Sep 15
04:34:13 2009] [info]: > CustomField Name: Change Control ((eval
1579):12)<BR>[Tue Sep 15 04:34:13 2009] [info]: > CustomField Value:
YES ((eval 1579):13)<BR>[Tue Sep 15 04:34:13 2009] [info]: > This
is a change control ((eval 1579):16)<BR>[Tue Sep 15 04:34:13 2009] [info]:
<<A
href="mailto:rt-3.8.4-3172-1252989253-875.246-3-0@hearstsc.com">rt-3.8.4-3172-1252989253-875.246-3-0@hearstsc.com</A>>
#246/34573 - Scrip 3 On Create Autoreply To Requestors
(/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:302)</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff size=2>So, by
scrip is being called, but, no tickets are being created;</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff size=2>The
scrip settings are;</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2>Condition: User Defined (as above)</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff size=2>Action
: Create Tickets</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2>Template : Monitor:Approval</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2>Stage : TransactionCreate</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff size=2>The
only other part to this that I know of is the Template. Other then the
template, is there anything else I need to do to auto create the approval
tickets?</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN><SPAN class=397224211-15092009><FONT face=Arial
color=#0000ff size=2>Here is my template;</FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2><BR>Subject: Approval of { $Tickets{'TOP'}->Subject() }<BR>Queue:
___Approvals<BR>Type : approval<BR>Owner : <A
href="mailto:slander@hearstsc.com">slander@hearstsc.com</A><BR>Content : Please
review and approve this request.<BR>Depended-On-By : TOP<BR></FONT></SPAN></DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=397224211-15092009><FONT face=Arial color=#0000ff
size=2> </DIV>
<DIV dir=ltr><BR></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV dir=ltr align=left><BR> <BR></DIV></FONT></SPAN></BLOCKQUOTE><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] <B>On Behalf Of </B>Lander,
Scott<BR><B>Sent:</B> Monday, September 14, 2009 5:20 PM<BR><B>To:</B>
'rt-users@lists.bestpractical.com'<BR><B>Subject:</B> [rt-users] Problem calling
a custom scrip<BR></FONT><BR></DIV>
<DIV></DIV><FONT face="Arial, sans-serif" size=2>
<DIV>All,</DIV>
<DIV> </DIV>
<DIV> In 3.8.4, I am attempting to set up an approval
queue. The idea is that if a Custom Field named "Change
Control" is set to value 'YES" then a new ticket will be created to gather the
required approval.</DIV>
<DIV> </DIV>
<DIV> This is in queue "Monitoring".</DIV>
<DIV> </DIV>
<DIV> So, in the queue I have a Scrip: Monitor:approval,
with a User Defined condition, Action is Create Tickets, Template is
Monitor:Approval, Stage TransactionComplete.</DIV>
<DIV> My Custom Condition originally was:</DIV>
<DIV> </DIV>
<DIV style="PADDING-LEFT: 38pt">if ($self->TransactionObj->Type ne
"Create") {</DIV>
<DIV style="PADDING-LEFT: 38pt"> return 0; # This is an update
transaction</DIV>
<DIV style="PADDING-LEFT: 38pt">}</DIV>
<DIV style="PADDING-LEFT: 38pt"> </DIV>
<DIV style="PADDING-LEFT: 38pt"> </DIV>
<DIV style="PADDING-LEFT: 38pt">my $CustomFields =
$ticket->QueueObj->TicketCustomFields();</DIV>
<DIV style="PADDING-LEFT: 38pt">while (my $CustomField =
$CustomFields->Next()) {</DIV>
<DIV style="PADDING-LEFT: 38pt"> if
($self->TicketObj->FirstCustomFieldValue('Change Control') =~ /Yes/i)
{</DIV>
<DIV style="PADDING-LEFT: 38pt"> return 1;</DIV>
<DIV style="PADDING-LEFT: 38pt">}</DIV>
<DIV style="PADDING-LEFT: 38pt"> </DIV>
<DIV style="PADDING-LEFT: 38pt">return 0;</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>When that failed to do anything, I just changed it to "return
1;". </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>My template is:</DIV>
<DIV> </DIV>
<DIV>Subject: Approval of { $Tickets{'TOP'}->Subject() }</DIV>
<DIV>Queue: ___Approvals</DIV>
<DIV>Type : approval</DIV>
<DIV>Owner : slander@hearstsc.com</DIV>
<DIV>Content : Please review and approve this request.</DIV>
<DIV>Depended-On-By : TOP</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>When I create a ticket and select YES for my CF, I see this in my
log; (note, my custom scrip is #84)</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>[Mon Sep 14 21:30:07 2009] [info]:
<rt-3.8.4-3173-1252963807-747.239-3-0@hearstsc.com> #239/34524 - Scrip 3
On Create Autoreply To Requestors
(/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:302)</DIV>
<DIV>[Mon Sep 14 21:30:07 2009] [info]:
<rt-3.8.4-3173-1252963807-747.239-3-0@hearstsc.com> sent To:
slander@hearstsc.com (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:333)</DIV>
<DIV>[Mon Sep 14 21:30:07 2009] [info]:
<rt-3.8.4-3173-1252963807-1595.239-4-0@hearstsc.com> #239/34524 - Scrip 4
On Create Notify AdminCcs (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:302)</DIV>
<DIV>[Mon Sep 14 21:30:07 2009] [info]:
<rt-3.8.4-3173-1252963807-1595.239-4-0@hearstsc.com> No recipients found.
Not sending. (/opt/rt3/bin/../lib/RT/Interface/Email.pm:338)</DIV>
<DIV>[Mon Sep 14 21:30:07 2009] [info]:
<rt-3.8.4-3173-1252963807-1456.239-82-0@hearstsc.com> #239/34524 - Scrip
82 On Create Notify CCs (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:302)</DIV>
<DIV>[Mon Sep 14 21:30:07 2009] [info]:
<rt-3.8.4-3173-1252963807-1456.239-82-0@hearstsc.com> sent Cc:
slander@hearstsc.com (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:333)</DIV>
<DIV>[Mon Sep 14 21:30:07 2009] [info]: Ticket 239 created in queue 'Monitoring'
by SLANDER (/opt/rt3/bin/../lib/RT/Ticket_Overlay.pm:667)</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Can anyone see my mistake? Or, am I going about this wrong?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></FONT><PRE>------------------------------------------------------------------------------------
This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst Service Center (cadmin@hearstsc.com) immediately by email and delete the original message.
------------------------------------------------------------------------------------
</PRE><pre>------------------------------------------------------------------------------------
This e-mail message is intended only for the personal use of the recipient(s) named above. If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the Hearst Service Center (cadmin@hearstsc.com) immediately by email and delete the original message.
------------------------------------------------------------------------------------
</pre></BODY></HTML>