<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">Hi All,</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">We just upgraded our RT from 3.8.4 to 4.0.1</SPAN></div><SPAN style="RIGHT: auto">
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">We upgraded the database also.</SPAN></div></SPAN>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">When we want to create a new custom field we are getting the following errors</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"><VAR id=yui-ie-cursor></VAR></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Can't coerce array into hash at /opt/rt3/sbin/../lib/RT/CustomField.pm line 696.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Can't coerce array into hash at /opt/rt3/sbin/../lib/RT/CustomField.pm line 620.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">What could be the problem.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">With Regards</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Vinod.R</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><BR style="RIGHT: auto"></div>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr contentEditable=false readonly="true"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Mauricio Tavares <raubvogel@gmail.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Mike Johnson <mike.johnson@nosm.ca><BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> rt-users@lists.bestpractical.com<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thursday, July 7, 2011 10:40 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [rt-users] Faking {$Transaction->Content()}<BR></FONT><BR>On Thu, Jul 7, 2011 at 9:59 AM, Mike Johnson <<A href="mailto:mike.johnson@nosm.ca" ymailto="mailto:mike.johnson@nosm.ca">mike.johnson@nosm.ca</A>>
 wrote:<BR>> Just trying to peice together the workflow from the last few emails, sorry<BR>> if I simplify it too much...<BR>><BR>> - previous owner comments on ticket with attachments<BR>> - somehow the owner changes(sounds like the previous owner may do this...<BR>> not sure though)<BR>> - email fires to new owner notifying him he owns this ticket<BR>> - new owner uses email to communicate with requestor<BR>><BR>      You got the workflow right. FYI, right now I am able to send an<BR>email to new owner that looks like the last correspondence in the<BR>ticket with two small exceptions:<BR><BR>o I created a header that indicates the new owner. Such header is only<BR>sent to the AdminCcs, not to the requestor or other CCs. Owner can use<BR>that header to filter out correspondence that is addressed to<BR>him/her/it.<BR><BR>o Non-text attachments are shown as links instead of being attached to<BR>the email being
 sent to the new owner. I would like to have them<BR>attached but right now I do not know how to do it. I probably need to<BR>learn how to create this email as a MIMEObj, which is my weakness<BR>right now.<BR><BR>> Your end state is<BR>> - owner changed<BR>> - requestor gets attachments<BR>> - new owner has a conduit to communicate to requestor via email<BR>><BR>> The last part of that workflow makes me assume you have a scrip that<BR>> notifies requestor on correspondence, so to me, the only thing that you need<BR>> to do to get your end state, make the previous owner add the attachments as<BR>> a correspondence instead of comment.<BR>><BR>> If your end state also requires the new owner to have a copy of the<BR>> attachments in his email, the previous owner can do a 1 time cc to the new<BR>> owner when he's sending the reply with the attachments.<BR>><BR>      But that would mean old
 owner would have to (a) pass ownership<BR>to new owner and (b) cc the new owner. That makes it easier for old<BR>owner to miss a step.<BR><BR>> If typing in the new owner's email address isn't reliable, there is an<BR>> extension out there that does autocomplete, might be of some use? I've only<BR>> looked at it once... not sure if it can be configured out of the box to do<BR>> what you need, but it would be a starting point.<BR>><BR>> Not sure if you can get the attachments from a previous transaction, but a<BR>> little user training may make it so you don't have to.<BR>><BR>      You should know by now it is easier to write code than to train users. ;)<BR><BR>> Thanks!<BR>> Mike.<BR>> On Tue, Jul 5, 2011 at 6:33 PM, Mauricio Tavares <<A href="mailto:raubvogel@gmail.com" ymailto="mailto:raubvogel@gmail.com">raubvogel@gmail.com</A>><BR>> wrote:<BR>>><BR>>> On Tue, Jul 5, 2011 at 6:25
 PM, Kenneth Crocker <<A href="mailto:kfcrocker@lbl.gov" ymailto="mailto:kfcrocker@lbl.gov">kfcrocker@lbl.gov</A>> wrote:<BR>>> > Mauricio,<BR>>> ><BR>>> > Why not just keep it simple and send them an email with some simple<BR>>> > ticket<BR>>> > info and the ticket id so they can just link to the ticket and see<BR>>> > whatever<BR>>> > info they need. They are going to need to go into the ticket anyway.<BR>>> > Clicking a link to the ticket won't take anymore time than clicking any<BR>>> > attachment in the email. AND if the ticket has several attachments (as<BR>>> > many<BR>>> > of ours do), this simplifies the process a great deal.<BR>>> ><BR>>>      I agree; I actually have that working (well the text part of the<BR>>> comment is shown on the ticket and then the non-text attachments are<BR>>> provided as
 links). Problem is that is what they want is the new<BR>>> ticket owner to get a complete copy of the last ticket correspondence<BR>>> so he can reply to it and it will be sent to the requestor. New owner<BR>>> should not need to go to the RT web interface to do that. And that has<BR>>> turned out to be a bit more challenging than I originally expected. :)<BR>>><BR>>> > Just a thought.<BR>>> ><BR>>> > Kenn<BR>>> ><BR>>> > On Tue, Jul 5, 2011 at 3:01 PM, Mauricio Tavares <<A href="mailto:raubvogel@gmail.com" ymailto="mailto:raubvogel@gmail.com">raubvogel@gmail.com</A>><BR>>> > wrote:<BR>>> >><BR>>> >> On Tue, Jul 5, 2011 at 5:55 PM, Mauricio Tavares <<A href="mailto:raubvogel@gmail.com" ymailto="mailto:raubvogel@gmail.com">raubvogel@gmail.com</A>><BR>>> >> wrote:<BR>>> >> > On Tue, Jul 5, 2011 at 5:51 PM,
 Kenneth Crocker <<A href="mailto:kfcrocker@lbl.gov" ymailto="mailto:kfcrocker@lbl.gov">kfcrocker@lbl.gov</A>><BR>>> >> > wrote:<BR>>> >> >> Mauricio,<BR>>> >> >><BR>>> >> >> Who are you sending the email to?<BR>>> >> >><BR>>> >> >   The new ticket owner.<BR>>> >> ><BR>>> >>      Something on these lines (not claiming to be proper or correct)<BR>>> >> is what I am trying to do:<BR>>> >><BR>>> >> {<BR>>> >>   my $Transactions = $Ticket->Transactions;<BR>>> >>   $RT::Logger->debug("Find Transaction");<BR>>> >>   $Transactions->Limit( FIELD => 'Type',<BR>>> >>                          VALUE => "Correspond"<BR>>> >>
                        );<BR>>> >>   $Transaction = $Transactions->Last;<BR>>> >>   $RT::Logger->debug("Found Transaction : $Transaction");<BR>>> >> }To: { $Ticket->OwnerObj->EmailAddress }<BR>>> >> Subject: { $Ticket->Subject() }<BR>>> >> RT-Attach-Message: yes<BR>>> >><BR>>> >> But I am not able to feed the $Transaction I want (the one I got above<BR>>> >> the headers) to RT-Attach-Message.<BR>>> >><BR>>> >> >> Kenn<BR>>> >> >> LBNL<BR>>> >> >><BR>>> >> >> On Tue, Jul 5, 2011 at 12:35 PM, Mauricio Tavares<BR>>> >> >> <<A href="mailto:raubvogel@gmail.com" ymailto="mailto:raubvogel@gmail.com">raubvogel@gmail.com</A>><BR>>> >> >> wrote:<BR>>>
 >> >>><BR>>> >> >>> On Tue, Jul 5, 2011 at 2:31 PM, Kenneth Crocker <<A href="mailto:kfcrocker@lbl.gov" ymailto="mailto:kfcrocker@lbl.gov">kfcrocker@lbl.gov</A>><BR>>> >> >>> wrote:<BR>>> >> >>> > Mauricio,<BR>>> >> >>> ><BR>>> >> >>> > What is it you want to do? It sounds like you want to put the<BR>>> >> >>> > last<BR>>> >> >>> > correspondence of a ticket into an email/template when the owner<BR>>> >> >>> > of<BR>>> >> >>> > a<BR>>> >> >>> > ticket<BR>>> >> >>> > is changed. Is that right? Technically, there WAS a transaction<BR>>> >> >>> > record<BR>>> >> >>> > created, but since it only involved an owner change, that's
 the<BR>>> >> >>> > only<BR>>> >> >>> > info on<BR>>> >> >>> > the transaction record.<BR>>> >> >>> ><BR>>> >> >>> > If this is what you want to do, it CAN be done fairly easily with<BR>>> >> >>> > a<BR>>> >> >>> > scrip.<BR>>> >> >>> > What you want to do is pull up the last comment transaction<BR>>> >> >>> > entered<BR>>> >> >>> > for<BR>>> >> >>> > that<BR>>> >> >>> > ticket. You can do that IN a template.<BR>>> >> >>> ><BR>>> >> >>>      Well, this what I want do do:<BR>>> >> >>><BR>>> >> >>> If ticket owner changed<BR>>> >> >>>   Send the
 last correspondence of a ticket into an email/template<BR>>> >> >>> (as<BR>>> >> >>> correspondence) to the new ticket owner.<BR>>> >> >>><BR>>> >> >>> When I mean last correspondence I do want to include every<BR>>> >> >>> attachment<BR>>> >> >>> (.zip files, jpg, etc)  it came with (like what you would get by<BR>>> >> >>> having RT-Attach-Message: yes), not only the textual content (which<BR>>> >> >>> is<BR>>> >> >>> what you would get by doing $Transaction->Content).<BR>>> >> >>><BR>>> >> >>> From what I understand, $Transaction->Content (and<BR>>> >> >>> RT-Attach-Message:<BR>>> >> >>> yes) need the last Transaction to be a correspondence type to do<BR>>> >>
 >>> their<BR>>> >> >>> magic. But since the transaction associated with owner changing<BR>>> >> >>> does<BR>>> >> >>> not generate a correspondence, I cannot use them as they are. Well,<BR>>> >> >>> as<BR>>> >> >>> you pointed out, getting the text part of the last correspondence<BR>>> >> >>> and<BR>>> >> >>> creating a correspondence with that as the content is, quite easy.<BR>>> >> >>> The<BR>>> >> >>> non-text attachments are causing me problems.<BR>>> >> >>><BR>>> >> >>> In my test script I grabbed only the transactions in that ticket<BR>>> >> >>> with<BR>>> >> >>> correspondence in them and am able to see which attachments the<BR>>> >> >>>
 last<BR>>> >> >>> correspondence had. That really does not do me any good but at<BR>>> >> >>> least<BR>>> >> >>> made me feel happy that I was able to find the attachments. :)<BR>>> >> >>><BR>>> >> >>> > Hope this helps.<BR>>> >> >>> ><BR>>> >> >>> > Kenn<BR>>> >> >>> > LBNL<BR>>> >> >>> ><BR>>> >> >>> > On Thu, Jun 30, 2011 at 2:59 PM, Mauricio Tavares<BR>>> >> >>> > <<A href="mailto:raubvogel@gmail.com" ymailto="mailto:raubvogel@gmail.com">raubvogel@gmail.com</A>><BR>>> >> >>> > wrote:<BR>>> >> >>> >><BR>>> >> >>> >>      From what I understand (thanks trs), in an on Owner Change<BR>>> >>
 >>> >> event<BR>>> >> >>> >> you cannot rely on using {$Transaction->Content()} to copy the<BR>>> >> >>> >> last<BR>>> >> >>> >> message/correspondence in a given ticket because no transaction<BR>>> >> >>> >> was<BR>>> >> >>> >> created. So, how can you fake it in an template? If the content<BR>>> >> >>> >> was<BR>>> >> >>> >> only a text file, it is not hard to do it, but what happens when<BR>>> >> >>> >> you<BR>>> >> >>> >> also have attachments? I wrote the following template,<BR>>> >> >>> >><BR>>> >> >>> >> {<BR>>> >> >>> >>   my $thingie = "Attachments:";<BR>>> >> >>> >>   my
 $Transactions = $Ticket->Transactions;<BR>>> >> >>> >><BR>>> >> >>> >>   $Transactions->Limit( FIELD => 'Type',<BR>>> >> >>> >>                           VALUE => "Correspond"<BR>>> >> >>> >>                         );<BR>>> >> >>> >>   # $Rt::Logger->debug("Find Transaction");<BR>>> >> >>> >>   my $TransactionObj = $Transactions->Last;<BR>>> >> >>> >>      my $AttachmentsObj =<BR>>> >> >>> >> RT::Attachments->new($TransactionObj->CurrentUser);<BR>>> >> >>> >>      $AttachmentsObj->Limit( FIELD =>
 'TransactionID',<BR>>> >> >>> >>                              VALUE => $TransactionObj->id<BR>>> >> >>> >>                            );<BR>>> >> >>> >>      while ( my $a = $AttachmentsObj->Next ) {<BR>>> >> >>> >>         $thingie .= "\nFound an attachment with encoding " .<BR>>> >> >>> >> $a->ContentType . " and ID " . $a->id;<BR>>> >> >>> >>         if ( $a->ContentType eq 'text/plain' || $a->ContentType<BR>>> >> >>> >> eq<BR>>> >> >>> >> 'text/html'){<BR>>> >> >>> >>      
      $thingie .= "\nContent:\n" . $a->Content;<BR>>> >> >>> >>         }<BR>>> >> >>> >>         elseif ( $a->ContentType eq 'multipart/mixed') {<BR>>> >> >>> >>         }<BR>>> >> >>> >>         else {<BR>>> >> >>> >>            $thingie .= "\n" . $RT::WebURL<BR>>> >> >>> >> ."/Ticket/Attachment/".<BR>>> >> >>> >> $a->TransactionId ."/". $a->id ."/". $a->Filename;<BR>>> >> >>> >>            $thingie .= "\n    ";<BR>>> >> >>> >>         }<BR>>> >> >>> >>      }<BR>>>
 >> >>> >>   $thingie;<BR>>> >> >>> >> }<BR>>> >> >>> >><BR>>> >> >>> >> which finds the attachments and put links for the non-text (from<BR>>> >> >>> >> http://requesttracker.wikia.com/wiki/AddAttachmentLinksToMail)<BR>>> >> >>> >> attachments, but what I really want is, well, emulate<BR>>> >> >>> >> {$Transaction->Content()}. Would anyone have any pointers?<BR>>> >> >>> >><BR>>> >> >>> >> --------<BR>>> >> >>> >> 2011 Training: http://bestpractical.com/services/training.html<BR>>> >> >>> ><BR>>> >> >>> ><BR>>> >> >>> ><BR>>> >> >>> > --------<BR>>> >> >>> > 2011
 Training: <A href="http://bestpractical.com/services/training.html" target=_blank>http://bestpractical.com/services/training.html</A><BR>>> >> >>> ><BR>>> >> >><BR>>> >> >><BR>>> >> >><BR>>> >> >> --------<BR>>> >> >> 2011 Training: <A href="http://bestpractical.com/services/training.html" target=_blank>http://bestpractical.com/services/training.html</A><BR>>> >> >><BR>>> >> ><BR>>> ><BR>>> ><BR>>> ><BR>>> > --------<BR>>> > 2011 Training: <A href="http://bestpractical.com/services/training.html" target=_blank>http://bestpractical.com/services/training.html</A><BR>>> ><BR>>><BR>>> --------<BR>>> 2011 Training: <A href="http://bestpractical.com/services/training.html"
 target=_blank>http://bestpractical.com/services/training.html</A><BR>><BR>><BR>><BR>> --<BR>> Mike Johnson<BR>> Datatel Programmer/Analyst<BR>> Northern Ontario School of Medicine<BR>> 955 Oliver Road<BR>> Thunder Bay, ON   P7B 5E1<BR>> Phone: (807) 766-7331<BR>> Email: <A href="mailto:mike.johnson@nosm.ca" ymailto="mailto:mike.johnson@nosm.ca">mike.johnson@nosm.ca</A><BR>><BR>><BR>> --------<BR>> 2011 Training: <A href="http://bestpractical.com/services/training.html" target=_blank>http://bestpractical.com/services/training.html</A><BR>><BR><BR>--------<BR>2011 Training: <A href="http://bestpractical.com/services/training.html" target=_blank>http://bestpractical.com/services/training.html</A><BR><BR><BR></DIV></DIV></div></body></html>