<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:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" 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 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @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;}
 /* 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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</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-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>Morning
Ken:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>Try
this :<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>Change
<o:p></o:p></span></p>

<p class=MsoNormal>my $message =
$ticket->Transactions->First->Content;<br>
<span style='font-family:"Calibri","sans-serif";color:#1F497D'>to<o:p></o:p></span></p>

<p class=MsoNormal>my $message = $self->TransactionObj->Content() ; #and
remove my $trans line –you don’t need it<o:p></o:p></p>

<p class=MsoNormal>or <o:p></o:p></p>

<p class=MsoNormal>my $message = $trans->Content() ;  #keeping my
$trans line<span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>Regards;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'>Roy<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<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"'> rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] <b>On Behalf Of </b>Kenneth
Crocker<br>
<b>Sent:</b> 11 October 2010 17:44<br>
<b>To:</b> rt-users@lists.bestpractical.com<br>
<b>Subject:</b> Re: [rt-users] Help with "Correspond" condition<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>Raed,<br>
<br>
Thanks for responding. Yse, I do have a "return 1; in the Custom PRep
area. Actually, I have tried getting this to work with the code in one or the
other Custom Action areas. As an explanation of the context, I have not been
able to get CommanByMail to update a Custom Field defined as either
"text" or "Wikitext" if the content is over 76 or so
characters. Apparantly, bith Gmail and Thunderbird and perhaps others email
providers embed a line break character after that many characters and that
causes a "line Break" in CBM and I end up with only partial updates.
So, being the stubborn person I am, I got a perl guy to write some code I could
put into a scrip that would examine the content of an email, look for a define
delimiter (like "Description of Issue:") in the content and put
everything after that delimiter into the Custom Field. Make sense? It did to
me. In fact, it works perfectly when I set the condition to a Type =
"Create" and message header = "received". But on a
Correspond (meaning an update email as opposed to a create), it just doesn't
seem to see the email at all. Nothing. Nada.<br>
Well, anyway, here's the code:<br>
<br>
# Setup initial values<br>
<br>
my $trans = $self->TransactionObj;<br>
my $ticket = $self->TicketObj;<br>
my $cf_obj = RT::CustomField->new($RT::SystemUser);<br>
my $cf_name = "Description";<br>
my $cf_value = "Didn't work";<br>
my $message = $ticket->Transactions->First->Content;<br>
my $passed = 0;<br>
my $content;<br>
my $line;<br>
<br>
# split up lines in content by line break<br>
<br>
my @lines = split("\n", $message);<br>
<br>
# walk thru @lines and find the description<br>
<br>
foreach $line (@lines)<br>
    {<br>
     if  ($passed == 1)<br>
         {<br>
          if  ($content =~
m/^\n$/)<br>
             
{<br>
              
$content = $content.$line;<br>
             
}<br>
          else<br>
             
{<br>
              
$content = $content."\n".$line;<br>
             
}<br>
         }<br>
     if  ($line =~ m/^Description of Issue:/)<br>
         {<br>
          $line =~ s/Description
of Issue://;<br>
          $content =
$content."\n".$line;<br>
          $passed = 1;<br>
         }<br>
    }<br>
<br>
$cf_value = $content;<br>
<br>
# set the value for CF Description<br>
<br>
$cf_obj->LoadByName( Name => $cf_name );<br>
$RT::Logger->debug( "Loaded \$cf_obj->Name = ".
$cf_obj->Name() ."\n" );<br>
$ticket->AddCustomFieldValue( Field=>$cf_obj, Value=>$cf_value,
RecordTransaction=>0 );<br>
<br>
return 1;<br>
<br>
Thanks for your help.<br>
<br>
Kenn<br>
LBNL<o:p></o:p></p>

<div>

<p class=MsoNormal>On Mon, Oct 11, 2010 at 2:36 AM, Raed El-Hames <<a
href="mailto:Raed.El-Hames@vialtus.com">Raed.El-Hames@vialtus.com</a>>
wrote:<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>Ken:</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'> </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>Can you post the code that you cut and pasted to get a
better idea of the problem.</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>Also something that I always fall into , is writing my
action code in “</span><span style='font-size:7.5pt;color:black'>Custom
action cleanup code:”  </span><span style='color:#1F497D'>and
forgetting about and leaving</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:7.5pt;color:black'>“Custom action preparation
code:”  </span><span style='color:#1F497D'>completely empty, you
will need </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>return true ; </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>there.</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'> </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'>Roy</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='color:#1F497D'> </span><o:p></o:p></p>

<div style='border:none;border-left:solid windowtext 1.5pt;padding:0cm 0cm 0cm 4.0pt;
border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color blue'>

<div>

<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;
border-color:-moz-use-text-color -moz-use-text-color'>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
lang=EN-US style='font-size:10.0pt'>From:</span></b><span lang=EN-US
style='font-size:10.0pt'> <a
href="mailto:rt-users-bounces@lists.bestpractical.com" target="_blank">rt-users-bounces@lists.bestpractical.com</a>
[mailto:<a href="mailto:rt-users-bounces@lists.bestpractical.com"
target="_blank">rt-users-bounces@lists.bestpractical.com</a>] <b>On Behalf Of </b>Kenneth
Crocker<br>
<b>Sent:</b> 08 October 2010 17:25<br>
<b>To:</b> <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a><br>
<b>Subject:</b> [rt-users] Help with "Correspond" condition</span><o:p></o:p></p>

</div>

</div>

<div>

<div>

<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'>To
List,<br>
<br>
I have some code that strips information out of the content and sticks it into
a Custom Field. IT works great when I trigger it with an condition set for
email create tickets. Every time, it works with no problem.<br>
<br>
However, when I set the condition for "On Correspond" it does
nothing. I want to be able to update that Custom FIeld the same way I create it
initially and I figured "On Correspond" was the right condition.
Apparently not.<br>
<br>
I look ed in the TRANSACTIONS Table and I See the Type as
"Correspond". So why doesn't the same code (I copied and pasted) that
works for a "Create" not work for "On Correspond"?<br>
<br>
My error messages (which don't make sense since I am user 146 and am a
SuperUser) are below:<br>
<br>
[Fri Oct  8 16:07:44 2010] [warning]: Couldn't enable user 146
(/opt/rt3/bin/../lib/RT/User_Overlay.pm:1143)<br>
[Fri Oct  8 16:12:51 2010] [error]: Group::HasMember was called with an
argument that isn't an RT::Principal or id. It's (undefined)
(/opt/rt3/bin/../lib/RT/Group_Overlay.pm:1046)<br>
<br>
<br>
Can anyone help me on this? I just need to get the condition right.<br>
<br>
Thanks.<br>
<br>
Kenn<br>
LBNL<o:p></o:p></p>

</div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</div>

</body>

</html>