Ive also tried my $Attachment = $self->TicketObj->TransactionObj->Attachments; my $Content = $Attachment->First->Content; but I get an error on that saying: 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)
From: [email protected] [mailto:[email protected]] On Behalf Of Robert Vicchiullo Sent: Friday, August 12, 2011 1:57 PM To: [email protected] Subject: [rt-users] help with scrip (search correspond body) Need a little help and would appreciate any advice. I am trying to write a scrip for "On Correspond Notify Requestors and Ccs" I have Condition set to User defined and stage set to transactionbatch. In Custom condition I have: my $Content = $self->TransactionObj->Attachments->First->Content; $RT::Logger->error($Content); if( $Content =~ m/Status\:/ ){ $RT::Logger->error("--->found Status..."); return 0; } $RT::Logger->error("--->NOT FOUND!!!"); return 1; but for some reason the content is always blank, and even weirder it somehow gets in the if statement and logs "--->found status..." 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??
-------- RT Training Sessions (http://bestpractical.com/services/training.html) * Chicago, IL, USA September 26 & 27, 2011 * San Francisco, CA, USA October 18 & 19, 2011 * Washington DC, USA October 31 & November 1, 2011 * Melbourne VIC, Australia November 28 & 29, 2011 * Barcelona, Spain November 28 & 29, 2011
