<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;">Alex<div><br></div><div>Thank you very much for the code snippet. It worked like a charm!!</div><div><br></div><div>Joe</div><div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Joe Kirby ,  Assistant Vice President, Business Systems</div><div>Division of Information Technology (DoIT) </div><div>Support Response -   <a href="http://www.umbc.edu/doit">http://www.umbc.edu/doit</a> </div><div>Administration 627</div><div>Office - 410-455-3020 </div><div>Email - <a href="mailto:kirby@umbc.edu">kirby@umbc.edu</a></div></div></span></span>
</div>
<br><div><blockquote type="cite"><br><br><br>Message: 9<br>Date: Thu, 17 Jul 2014 00:57:44 +1000<br>From: Alex Peters <<a href="mailto:alex@peters.net">alex@peters.net</a>><br>To: "<a href="mailto:rt-users@lists.bestpractical.com">rt-users@lists.bestpractical.com</a>"<br><span class="Apple-tab-span" style="white-space:pre">       </span><<a href="mailto:rt-users@lists.bestpractical.com">rt-users@lists.bestpractical.com</a>><br>Subject: Re: [rt-users] Help with setting RT Due Date<br>Message-ID:<br><span class="Apple-tab-span" style="white-space:pre">  </span><<a href="mailto:CAFdkmpscs5-5r=v+3uTiOWAz10WtDUPb6RNwyjdhvT8Uemmkfw@mail.gmail.com">CAFdkmpscs5-5r=v+3uTiOWAz10WtDUPb6RNwyjdhvT8Uemmkfw@mail.gmail.com</a>><br>Content-Type: text/plain; charset="utf-8"<br><br>You can use something like:<br><br>$self->TicketObj->FirstCustomFieldValue('Need-By-Date')<br><br>to retrieve the value of the custom field.  Because the custom field is<br>free-form text and the date could be entered in any format, it is probably<br>wisest to run the field through an RT::Date object (to manage the free-form<br>parsing via Time::ParseDate) and then apply that to the ticket:<br><br>my $date = RT::Date->new($self->TransactionObj->CreatorObj);<br>$date->Set(<br>    Value => $self->TicketObj->FirstCustomFieldValue('Need-By-Date'),<br>    Format => 'unknown',<br>);<br>$self->TicketObj->SetDue($date->ISO);<br><br>This code is untested and doesn't take into account an unparseable date.  I<br>would guess that if the user enters an unparseable date, the Due date will<br>simply remain unset.<br><br>You mention "errors of various kinds" in your earlier post.  It could be<br>useful to see both those errors and the code triggering those errors.<br><br><br>On 17 July 2014 00:45, Alex Peters <<a href="mailto:alex@peters.net">alex@peters.net</a>> wrote:<br><br><blockquote type="cite">---------- Forwarded message ----------<br>From: Joe Kirby <<a href="mailto:kirby@umbc.edu">kirby@umbc.edu</a>><br>Date: 16 July 2014 21:24<br>Subject: Re: [rt-users] Help with setting RT Due Date<br>To: Alex Peters <<a href="mailto:alex@peters.net">alex@peters.net</a>><br><br><br>Thank you. I had forgotten that but in the end I still have the issue of<br>trying to update the due date from a CF because I have a web form that<br>captures this data and I need to populate the due date field<br><br>Thank you for responding<br><br>Joe<br><br> Joe Kirby ,  Assistant Vice President, Business Systems<br>Division of Information Technology (DoIT)<br>Support Response -   <a href="http://www.umbc.edu/doit">http://www.umbc.edu/doit</a><br>Administration 627<br>Office - 410-455-3020<br>Email - <a href="mailto:kirby@umbc.edu">kirby@umbc.edu</a><br><br>On Jul 15, 2014, at 10:16 PM, Alex Peters <<a href="mailto:alex@peters.net">alex@peters.net</a>> wrote:<br><br>Entry of due date is possible at ticket creation by clicking the Details<br>"tab" at the top right of the form.<br>On 16/07/2014 6:50 am, "Joe Kirby" <<a href="mailto:kirby@umbc.edu">kirby@umbc.edu</a>> wrote:<br><br><blockquote type="cite">I have a need to prompt the user for the desired need by date at ticket<br>creation. I did not see how to use the RT due date so I created a field<br>called Need-By-Date and set it up as Mandatory and Select Date.<br><br>I need to set the RT Due Date to this value and I keep getting errors of<br>various kinds.<br><br>I did look through the wiki and found AddDays, etc. functions but really<br>did not see anything that would achieve this.<br><br>Can you help?<br><br>Thanks<br><br>Joe<br><br> Joe Kirby ,  Assistant Vice President, Business Systems<br>Division of Information Technology (DoIT)<br>Support Response -   <a href="http://www.umbc.edu/doit">http://www.umbc.edu/doit</a><br>Administration 627<br>Office - 410-455-3020<br>Email - <a href="mailto:kirby@umbc.edu">kirby@umbc.edu</a><br><br><br>--<br>RT Training - Boston, September 9-10<br><a href="http://bestpractical.com/training">http://bestpractical.com/training</a><br><br></blockquote><br><br><br></blockquote>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <<a href="http://lists.bestpractical.com/pipermail/rt-users/attachments/20140717/b04f8313/attachment-0001.html">http://lists.bestpractical.com/pipermail/rt-users/attachments/20140717/b04f8313/attachment-0001.html</a>><br><br><br><br>Subject: Digest Footer<br><br>-- <br>-- <br>RT Training London, March 19-20 and Dallas May 20-21<br><a href="http://bestpractical.com/training">http://bestpractical.com/training</a><br>--------<br>rt-users mailing list<br>rt-users@lists.bestpractical.com<br>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users<br><br>------------------------------<br><br>End of rt-users Digest, Vol 124, Issue 17<br>*****************************************<br></blockquote></div><br></div></body></html>