<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:12.0pt;
        font-family:"Times New Roman","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;}
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";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-AU;}
.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"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hey Landon,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks a heap for the feedback.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Problem 1 is now FIXED thanks to you!
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Final code for the ExtractCustomFieldValues template for those who are interested, ended up being:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                # Set the jobs Due Date from E-mail Body<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">|Body|(?<=Open Date:    ).*|my $Due = new RT::Date( $self->CurrentUser ); $Due->Set(Format => "unknown", Value => $value); $Due->AddDays(
 -1 ); $self->TicketObj->SetDue( $Due->ISO );|q|<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Though I did then have some interesting hic-cups with it arguing with the SLA mod…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">When the E-mail Value Extract was picking up the date, the SLA mod was promptly altering it. Ended up having to remove the default SLA, manually define the
 SLA for all other queues (not a BAD thing) and then create a new scrip for on CREATE to make it set the STARTS date otherwise the Priority Escalate process wouldn’t work….<!!><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">As for Problem 2 – your suggestion sadly didn’t work.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-top:18.0pt"><b><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#15355B">Dave Fitches</span></b><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;page-break-after:avoid">
<span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#15355B">Security Software Administrator | Security Systems | Property and Campus Services<br>
BN203, 213-215 Grattan Street<br>
The University of Melbourne, Victoria 3010, Australia<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#15355B">T</span></b><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#15355B"> +61 3 8344 9232 |
<b>M</b> +61 411 811 525 | <b>F </b>+61 3 9349 5175 | </span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="mailto:dfitches@unimelb.edu.au"><span style="font-size:7.0pt;font-family:"Verdana","sans-serif"">dfitches@unimelb.edu.au</span></a></span><span style="font-size:7.0pt;font-family:"Verdana","sans-serif";color:#15355B"> |
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="http://securitysystems.unimelb.edu.au/" target="_blank"><span style="font-size:7.0pt;font-family:"Verdana","sans-serif"">securitysystems.unimelb.edu.au</span></a></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;page-break-after:avoid">
<b><span style="font-size:9.0pt;font-family:"Calibri","sans-serif";color:#365F91"><img border="0" width="179" height="47" id="Picture_x0020_1" src="cid:image001.png@01CE9D82.D9F36780" alt="cid:image001.png@01CDDD27.F59750D0"></span></b><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:black"><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;font-family:"Calibri","sans-serif";color:gray">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"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Landon [mailto:landonstewart@gmail.com]
<br>
<b>Sent:</b> Tuesday, 20 August 2013 3:35 AM<br>
<b>To:</b> Dave Fitches<br>
<b>Cc:</b> rt-users@lists.bestpractical.com<br>
<b>Subject:</b> Re: [rt-users] Setting Due Dates from E-mail and writing Comments to transaction history from Custom Scrips<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">On 18 August 2013 22:05, Dave Fitches <<a href="mailto:david.fitches@unimelb.edu.au" target="_blank">david.fitches@unimelb.edu.au</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">My template goes something like this:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:36.0pt">
# Set the jobs Due Date from E-mail Body<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">This does NOT work for me…
<span style="font-family:Wingdings">L</span>  <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">$due_date needs to be an RT::Date object in order to use set or ISO.  Is it?  <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">ie:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$due_date = new RT::Date( $self->CurrentUser );<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$due_date->Set(Format => "ISO", Value => $value);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$self->TicketObj->SetDue( $due_date->ISO );<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Since your dates are not in ISO format I'd probably recommend using Format => 'unknown' to set the RT::Date figure it out.  It takes a few extra cycles but provides flexibility when needed.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I use this:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">my $Due = new RT::Date( $self->CurrentUser );<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$Due->Set( Format => 'unknown', Value => 'now + 24 hours');<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">$ticket->SetDue($Due->ISO);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Problem #2: Writing a comment to the transaction history<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">                                CUSTOM ACTION CLEANUP CODE:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">                                                $self->TicketObj->Comment(Content =>"Notification sent to original requestor that their order has been processed."<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:72.0pt;text-indent:36.0pt">
);<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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>
</div>
</blockquote>
<div>
<p class="MsoNormal">If I'm understanding you correctly and if memory serves me I *think* you can just add RecordTransaction => 1 to the end of this and it'll do what you want.  I know this works for AddCustomFieldValue() but I'm not 100% sure if it works for
 Comment().  Worth a try though.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">$self->TicketObj->Comment(Content =>"Notification sent to original requestor that their order has been processed.", RecordTransaction => 1);<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Landon Stewart <<a href="mailto:LandonStewart@Gmail.com">LandonStewart@Gmail.com</a>><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>