<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-AU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Two problems I’ve been bashing my head against a wall with – any and all assistance appreciated!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Problem 1:  Setting the Due Date based on input from an E-mail<o:p></o:p></p>
<p class="MsoNormal">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<o:p></o:p></p>
<p class="MsoNormal">We’re using web-forms to generate e-mails into RT which presents the information in an organised and standard manner.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">An example is below:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:30.0pt;background:#EFEFEF"><span lang="EN" style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-AU">Door Times Request Form :<br>
<br>
Details:<br>
<br>
Campus: Parkville<br>
Door Name: 203<br>
Door Name: TEST JOB - DISREGARD<br>
<br>
<br>
Open Date: 21/08/2013<br>
Open Time: 18:00<br>
<br>
Close Date: 21/08/2013<br>
Close Time: 19:00<br>
<br>
<br>
Building Supervisor: Testy McTest Alot<br>
Department/Faculty Representitive: Campus Operations Group<br>
<br>
Requested By: Dave Fitches<br>
Email: dfitches@unimelb.edu.au<br>
<br>
Comments: Test job to get due date set for start date as defined by web form.<br>
<br>
-#-<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I want to grab the “Open Date: “ date and set it to the ticket’s DUE date (Id actually prefer to have to due the day BEFORE that, but lets work on one thing at a time shall we!)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m using ExtractCustomFieldValues running to pluck information from these e-mails.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My template goes something like this:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt"># Set the jobs Due Date from E-mail Body<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">|Body|(?<=Open Date:    ).*|my $due_date = $value; $due_date->Set(Format => "ISO", Value => $value); $self->TicketObj->SetDue( $due_date->ISO );|q|<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This does NOT work for me… <span style="font-family:Wingdings">
L</span>  <o:p></o:p></p>
<p class="MsoNormal">Instead I get: “ [Mon Aug 19 04:47:17 2013] [error]: Can't call method "Set" on an undefined value at (eval 1293) line 1. “ in my logs…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Problem #2: Writing a comment to the transaction history<o:p></o:p></p>
<p class="MsoNormal">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve got automatic e-mails being sent to requestors on status changes (we go from New->Open->Ordered->Dispatched->Resolved)<o:p></o:p></p>
<p class="MsoNormal">The e-mail goes out ok, but I’d like it to log a comment to the transaction history that says so.<o:p></o:p></p>
<p class="MsoNormal">While it shows up in my main HISTORY display, my DISPLAY history is masked to only show comments and correspondence, so I’d like a single comment line there to make seeing whats happened easier…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve got a custom scrip which goes like this:<o:p></o:p></p>
<p class="MsoNormal">________________________________________________________________________________________<o:p></o:p></p>
<p class="MsoNormal">                DESCRIPTION:    On Ordered Notify Requestors<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">CONDITION:       User Defined<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">ACTION:               Notify Requestors and CC’s<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">TEMPLATE:         Auto-Report – Ordered<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">STAGE:                 TransactionCreate<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">                CUSTOM CONDITIONS:<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">                                my $txn = $self->TransactionObj;<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:72.0pt;text-indent:36.0pt">my $type = $txn->Type;<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:72.0pt;text-indent:36.0pt">return 0 unless $type eq "Status"<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:72.0pt;text-indent:36.0pt">    || ( $type eq 'Set' && $txn->Field eq 'Status');<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">                                <o:p>
</o:p></p>
<p class="MsoNormal" style="margin-left:72.0pt;text-indent:36.0pt">return 0 unless $txn->NewValue eq "ordered";<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:72.0pt;text-indent:36.0pt">return 1;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">                                CUSTOM ACTION PREPARATION CODE:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">                                CUSTOM ACTION CLEANUP CODE:<o:p></o:p></p>
<p class="MsoNormal">                                                $self->TicketObj->Comment(Content =>"Notification sent to original requestor that their order has been processed."<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:72.0pt;text-indent:36.0pt">);<o:p></o:p></p>
<p class="MsoNormal">                                                <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:72.0pt;text-indent:36.0pt">return 1;<o:p></o:p></p>
<p class="MsoNormal">________________________________________________________________________________________<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I suspect the issue is in the cleanup code…. But it LOOKS correct! (to me – but I’m a n00b apparently!)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Sorry for such a long e-mail. Again, any assistance would be greatly appreciated!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-top:18.0pt"><b><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#15355B;mso-fareast-language:EN-AU">Dave Fitches</span></b><span style="font-size:10.5pt;color:black;mso-fareast-language:EN-AU"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<span style="font-size:7.5pt;color:gray;mso-fareast-language:EN-AU">This email and any attachments may contain personal information or information that is otherwise confidential or the subject of copyright. Any use, disclosure or copying of any part of it is
 prohibited. The University does not warrant that this email or any attachments are free from viruses or defects. Please check any attachments for viruses and defects before opening them. If this email is received in error please delete it and notify us by
 return email. And I’m only using this signature template because I’m told I must conform. Personally I liked my old one better - but that’s life! ;)<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>