[rt-users] how to access content for an attachment in scrip?

John Alberts John.Alberts at exlibrisgroup.com
Wed Jul 6 16:06:34 EDT 2011


Hi. I'm trying to customize the scrip shown at the bottom of this wiki page: http://requesttracker.wikia.com/wiki/AutoCloseOnNagiosRecoveryMessages

I know there is an extension that does merging, but I want to do some other things with the Nagios variables I have attached as a plain text file to the ticket that Nagios creates in RT.
The first few lines in the scrip attempt to get the content of an attachment and put it in a variable named $content.  I suspected that this was not working, so I added a debug line to dump the contents of $contents and it is empty.

Here is the scrip code.
   my $T_Obj = $self->TicketObj;
   my $AttachObj = $self->TransactionObj->Attachments->First;
   my $content = $AttachObj->Content;
   $RT::Logger->debug("Contents: " . $content);


The log output shows:
[Wed Jul  6 19:47:49 2011] [debug]:  Contents: ((eval 3934):4)


The attachment is attached to the ticket.  I can see it in the web ui and can open and read it with no problems.  Any idea what I'm doing wrong here?


Thanks


John


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110706/76cc7b6a/attachment.htm>


More information about the rt-users mailing list