<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;"><font class="Apple-style-span" color="#000000" size="4"><span class="Apple-style-span" style="font-size: 14px;">Using the rt console, I can
 see that there are actually 3 attachments, even though the I only sent one and the web ui only shows 1, so I'm sure the problem is that I'm selecting the wrong attachment.</span></font></span></font></div>
</div>
</div>
<div><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;"><font class="Apple-style-span" color="#000000" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br>
</span></font></span></font></div>
<div><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;"><font class="Apple-style-span" color="#000000" size="4"><span class="Apple-style-span" style="font-size: 14px;">Here's what I see from the console.</span></font></span></font></div>
<div><font class="Apple-style-span" color="#1F497D" size="4"><span class="Apple-style-span" style="font-size: 15px;"><font class="Apple-style-span" color="#000000" size="4"><span class="Apple-style-span" style="font-size: 14px;">
<div><span style="font-family: Consolas; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;">./rt show 2075/attachments              </span></font></span></div>
<div><span style="font-family: Consolas; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;">19671: (Unnamed) (multipart/mixed / 0b),</span></font></span></div>
<div><span style="font-family: Consolas; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;">19672: (Unnamed) (text/plain / 305b),</span></font></span></div>
<div><span style="font-family: Consolas; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;">19673: env-vars.txt (application/octet-stream / 16.8k)</span></font></span></div>
<div><br>
</div>
<div><br>
</div>
<div>The attachment I would like will always be named env-vars.txt.  How can I get the contents for the attachment name env-vars.txt?</div>
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div>John</div>
<div><br>
</div>
</span></font></span></font></div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>John Alberts <<a href="mailto:john.alberts@exlibrisgroup.com">john.alberts@exlibrisgroup.com</a>><br>
<span style="font-weight:bold">Date: </span>Wed, 6 Jul 2011 20:06:34 +0000<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:rt-users@lists.bestpractical.com">rt-users@lists.bestpractical.com</a>" <<a href="mailto:rt-users@lists.bestpractical.com">rt-users@lists.bestpractical.com</a>><br>
<span style="font-weight:bold">Subject: </span>[rt-users] how to access content for an attachment in scrip?<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>Hi. I'm trying to customize the scrip shown at the bottom of this wiki page: <a href="http://requesttracker.wikia.com/wiki/AutoCloseOnNagiosRecoveryMessages">http://requesttracker.wikia.com/wiki/AutoCloseOnNagiosRecoveryMessages</a></div>
<div><br>
</div>
<div>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.</div>
<div>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.</div>
<div><br>
</div>
<div>Here is the scrip code.</div>
<div>
<div>   my $T_Obj = $self->TicketObj;</div>
<div>   my $AttachObj = $self->TransactionObj->Attachments->First;</div>
<div>   my $content = $AttachObj->Content;</div>
<div>   $RT::Logger->debug("Contents: " . $content);</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>The log output shows:</div>
<div>[Wed Jul  6 19:47:49 2011] [debug]:  Contents: ((eval 3934):4)</div>
<div><br>
</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div><br>
</div>
<div>John</div>
<div><br>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">
<font class="Apple-style-span" color="#1F497D"><br>
</font></p>
</div>
</div>
</div>
</div>
</div>
</div>
-------- 2011 Training: <a href="http://bestpractical.com/services/training.html">
http://bestpractical.com/services/training.html</a></span>
</body>
</html>