<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word"><head><META content="text/html; charset=utf-8" http-equiv="Content-Type">

<STYLE><!--         /* Style Definitions */         p.91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b, li.91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b, div.91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b, table.91253ab2-9a1f-4ee1-8d9d-dea79fc1d49bTable         {margin:0cm;    margin-bottom:.0001pt;}        div.Section1        {page:Section1;}        --></STYLE>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type><meta content="Microsoft Word 14 (filtered medium)" name=Generator><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 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;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.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>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"><div class=WordSection1><p class=MsoNormal>Hi all,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m running RT 3.8.7 on Ubuntu 10.04 for a couple of months now so am fairly comfortable with the basics. I’d like to be able to record requestor info in custom fields with a ticket so that when an engineer is assigned the ticket this info can be part of the summary mailed to them.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve read that I can do this via a scrip and already have custom fields being set to default values but I can’t figure out what objects(Is this the correct term?) to set my user info custom field to?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>What I’m asking is pretty much the same as here <a href="http://www.gossamer-threads.com/lists/rt/users/98591">http://www.gossamer-threads.com/lists/rt/users/98591</a> but I rather not use the callbacks just yet – I’d like to get my head around scrips and objects/variables first.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I found the code below and modified it slightly I can’t remember its original function or where I found it for that matter but it was similar to what I was after – I think! Unfortunately I’m not getting anything stored in the Custom Field<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>my $T_Obj = $self->TicketObj;<o:p></o:p></p><p class=MsoNormal>my $requestor_address = $T_Obj->RequestorAddresses;<o:p></o:p></p><p class=MsoNormal>my $cf_value;<o:p></o:p></p><p class=MsoNormal>my $CF_Obj = RT::CustomField->new($self->CurrentUser);<o:p></o:p></p><p class=MsoNormal>my $cf_name = "CSM Name"; #change this to the CF name<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>$requestor_address =~ /(^.+)@([^\.].*\.[a-z]{2,}$)/;<o:p></o:p></p><p class=MsoNormal>$cf_name = $1<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>$CF_Obj->LoadByName( Name => $cf_name,);<o:p></o:p></p><p class=MsoNormal>$RT::Logger->debug( "Loaded \$CF_Obj->Name = ". $CF_Obj->Name() ."\n" );<o:p></o:p></p><p class=MsoNormal>$CF_Obj->AddValueForObject( Object  => $self->TicketObj,Content => $cf_value, );<o:p></o:p></p><p class=MsoNormal>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>Can someone point me in the right direction is the code I’m using even close?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks in advance and let me know if you need more info,<o:p></o:p></p><p class=MsoNormal>Peter<o:p></o:p></p></div> </P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"> </P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"> <IMG ALIGN="baseline" ALT BORDER="0" HSPACE="0" SRC="cid:imageb71c53.jpg@8df89660.7371484b"></P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"><FONT FACE="Arial"> <FONT COLOR="#000000" SIZE="4"><STRONG>Peter Nugent</STRONG></FONT> <FONT COLOR="#c0c0c0">| Technical Director | +353 (0) 45-531262 | +353 (0) 45-940522</FONT></FONT></P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"><FONT COLOR="#c0c0c0" FACE="Arial">Leinster Mills | Osberstown | Naas | Co. Kildare | Ireland | <a href="mailto:peter.nugent@hetg.ie">peter.nugent@hetg.ie</a> |<FONT COLOR="#000000"> </FONT><FONT COLOR="#ac17d7"><a href="http://www.hetg.ie">www.hetg.ie</a></FONT></FONT></P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"><FONT COLOR="#c0c0c0" FACE="Arial"></FONT> </P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b">
<HR>

<P></P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"><SPAN STYLE="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Arial','sans-serif'"><FONT COLOR="#333333">Hibernia Computer Services (KILDARE) T/A Hibernia Evros Technology Group Registered in Ireland No. 425932<BR>Registered Office: Block G, Cherrywood Science & Technology Park, Loughlinstown, Co. Dublin</FONT></SPAN> </P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"> </P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"> </P>
<P CLASS="91253ab2-9a1f-4ee1-8d9d-dea79fc1d49b"></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P>
<P></P></P></BODY></HTML>