<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
.MsoChpDefault
        {font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
        {}
-->
</style>
</head>
<body lang="EN-CA" link="blue" vlink="purple">
<div style="width:100%; font-size:initial; font-family:Calibri,'Slate Pro',sans-serif; color:rgb(31,73,125); text-align:initial; background-color:rgb(255,255,255)">
Never mind, figured it out. Status is in lowercase. </div>
<div style="width:100%; font-size:initial; font-family:Calibri,'Slate Pro',sans-serif; color:rgb(31,73,125); text-align:initial; background-color:rgb(255,255,255)">
<br style="display:initial">
</div>
<div style="font-size:initial; font-family:Calibri,'Slate Pro',sans-serif; color:rgb(31,73,125); text-align:initial; background-color:rgb(255,255,255)">
Thanks, <br>
<br>
Rob</div>
<table width="100%" style="background-color:white; border-spacing:0px">
<tbody>
<tr>
<td colspan="2" style="font-size:initial; text-align:initial; background-color:rgb(255,255,255)">
<div id="_persistentHeader" style="border-style:solid none none; border-top-color:rgb(181,196,223); border-top-width:1pt; padding:3pt 0in 0in; font-family:Tahoma,'BB Alpha Sans','Slate Pro'; font-size:10pt">
<div><b>From: </b>Rob Moerman</div>
<div><b>Sent: </b>Friday, June 27, 2014 2:35 PM</div>
<div><b>To: </b>rtir@lists.bestpractical.com</div>
<div><b>Subject: </b>[Rtir] Help with custom condition on scrip</div>
</div>
</td>
</tr>
</tbody>
</table>
<div style="border-style:solid none none; border-top-color:rgb(186,188,209); border-top-width:1pt; font-size:initial; text-align:initial; background-color:rgb(255,255,255)">
</div>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal">Hi there,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I’m trying to get a custom scrip to run on a status change to “Active” on an RT 4.2.5 installation.
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The queue is using a custom lifecycle that includes status’ of Pending > Active > Contained > Resolved > Rejected > Deleted.  All of the transitions and lifecycles have been defined and there is no issue creating, moving or transitioning
 tickets through the various statuses.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I’ve created a custom scrip with condition “User Defined” and action “User Defined” (for testing purposes, although the intention is to eventually have the scrip send an email to a distribution group.
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The “Custom Condition” looks like this (based on example code taken from http://requesttracker.wikia.com/wiki/CustomConditionSnippets):</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">my $txn = $self->TransactionObj;</p>
<p class="MsoNormal">my $type = $txn->Type;</p>
<p class="MsoNormal">return 0 unless $type eq "Status" </p>
<p class="MsoNormal" style="text-indent:36.0pt">|| ( $type eq 'Set' && $txn->Field eq 'Status');</p>
<p class="MsoNormal">return 0 unless $txn->NewValue eq "Active";</p>
<p class="MsoNormal">return 1; </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The “Custom action preparation code” looks like this: </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">$RT::Logger->debug("!!!WORKS!!!\n");</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">This is just to dump out some text to the logs to confirm if the condition is working as intended.  It is not, and the logs show “Skipping Scrip #18 because it isn’t applicable” (This would be the scrip in question).</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I’ve tried this as both a normal and a batch script and it won’t fire.
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Appreciate any insight. </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"">Robert Moerman, CISSP</span></p>
<p class="MsoNormal"><b><span style="font-size:8.0pt; font-family:"Arial","sans-serif"">Manager, Security Monitoring & Threat Response</span></b></p>
<p class="MsoNormal"><b><span style="font-size:8.0pt; font-family:"Arial","sans-serif"">Information Security Operations Center</span></b></p>
<p class="MsoNormal"> </p>
</div>
<br>
<br>
<br>
<br>
<hr width="100%">
This communication is confidential. We only send and receive email on the basis of the terms set out at
<a href="http://www.rogers.com/web/content/emailnotice">www.rogers.com/web/content/emailnotice</a><br>
<br>
<br>
<br>
Ce message est confidentiel. Notre transmission et réception de courriels se fait strictement suivant les modalités énoncées dans l’avis publié à
<a href="http://www.rogers.com/aviscourriel
">www.rogers.com/aviscourriel </a>
<hr width="100%">
</div>
<br>
<br>
<br>
<br>
<hr width="100%">
This communication is confidential. We only send and receive email on the basis of the terms set out at
<a href="http://www.rogers.com/web/content/emailnotice">www.rogers.com/web/content/emailnotice</a><br>
<br>
<br>
<br>
Ce message est confidentiel. Notre transmission et réception de courriels se fait strictement suivant les modalités énoncées dans l’avis publié à
<a href="http://www.rogers.com/aviscourriel
">www.rogers.com/aviscourriel </a>
<hr width="100%">
</body>
</html>