<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Ive also tried<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">my $Attachment = $self->TicketObj->TransactionObj->Attachments;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">my $Content = $Attachment->First->Content;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">but I get an error on that saying:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">ug 12 15:48:01 rt RT: Scrip 6 IsApplicable failed: Can't locate object method "Attachments" via package "No object mapping for field" (perhaps you forgot to load "No object mapping for field"?) at (eval 538)
line 1. Stack: [(eval 538):1] [/opt/rt4/sbin/../lib/RT/ScripCondition.pm:207] [/opt/rt4/sbin/../lib/RT/Scrip.pm:410] [/opt/rt4/sbin/../lib/RT/Scrips.pm:225] [/opt/rt4/sbin/../lib/RT/Transaction.pm:179] [/opt/rt4/sbin/../lib/RT/Record.pm:1447]
[/opt/rt4/sbin/../lib/RT/Ticket.pm:2237] [/opt/rt4/sbin/../lib/RT/Ticket.pm:2145] [/opt/rt4/local/plugins/RT-Extension-CommandByMail/lib/RT/Interface/Email/Filter/TakeAction.pm:341] [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1612] [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1429]
[/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61] (/opt/rt4/sbin/../lib/RT/Condition/UserDefined.pm:65)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com]
<b>On Behalf Of </b>Robert Vicchiullo<br>
<b>Sent:</b> Friday, August 12, 2011 1:57 PM<br>
<b>To:</b> RT-Users@lists.bestpractical.com<br>
<b>Subject:</b> [rt-users] help with scrip (search correspond body)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Need a little help and would appreciate any advice.<o:p></o:p></p>
<p class="MsoNormal">I am trying to write a scrip for <o:p></o:p></p>
<p class="MsoNormal">“On Correspond Notify Requestors and Ccs”<o:p></o:p></p>
<p class="MsoNormal">I have Condition set to User defined and stage set to transactionbatch.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In Custom condition I have:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">my $Content = $self->TransactionObj->Attachments->First->Content;<o:p></o:p></p>
<p class="MsoNormal">$RT::Logger->error($Content);<o:p></o:p></p>
<p class="MsoNormal">if( $Content =~ m/Status\:/ ){<o:p></o:p></p>
<p class="MsoNormal"> $RT::Logger->error("--->found Status...");<o:p></o:p></p>
<p class="MsoNormal"> return 0;<o:p></o:p></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal">$RT::Logger->error("--->NOT FOUND!!!");<o:p></o:p></p>
<p class="MsoNormal">return 1;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">but for some reason the content is always blank, and even weirder it somehow gets in the if statement and logs “-<span style="font-family:Wingdings">à</span>found status…”<o:p></o:p></p>
<p class="MsoNormal">so first off why is it not finding the content, I want to simply check the body of the email for a string, which I found multiple places on the wiki and list using the above way. Second why is the if statement finding “Status:” in an empty
string??<o:p></o:p></p>
</div>
</body>
</html>