Peter,<br><br>What User values do you want to save from the Requestor (I assume they are on the User Table) and what are the corresponding Custom Fields for each of those values and what "type" did you set the CF's at?<br>
<br>Kenn<br>LBNL<br><br><div class="gmail_quote">On Thu, Feb 17, 2011 at 2:35 AM, Peter Nugent <span dir="ltr"><<a href="mailto:peter.nugent@hetg.ie">peter.nugent@hetg.ie</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>
<p></p><div><p class="MsoNormal">Hi all,</p><p class="MsoNormal"> </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.</p>
<p class="MsoNormal"> </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?</p>
<p class="MsoNormal"> </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" target="_blank">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.</p>
<p class="MsoNormal"> </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</p>
<p class="MsoNormal"> </p><p class="MsoNormal">my $T_Obj = $self->TicketObj;</p><p class="MsoNormal">my $requestor_address = $T_Obj->RequestorAddresses;</p><p class="MsoNormal">my $cf_value;</p><p class="MsoNormal">
my $CF_Obj = RT::CustomField->new($self->CurrentUser);</p><p class="MsoNormal">my $cf_name = "CSM Name"; #change this to the CF name</p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal">
$requestor_address =~ /(^.+)@([^\.].*\.[a-z]{2,}$)/;</p><p class="MsoNormal">$cf_name = $1</p><p class="MsoNormal"> </p><p class="MsoNormal">$CF_Obj->LoadByName( Name => $cf_name,);</p><p class="MsoNormal">$RT::Logger->debug( "Loaded \$CF_Obj->Name = ". $CF_Obj->Name() ."\n" );</p>
<p class="MsoNormal">$CF_Obj->AddValueForObject( Object => $self->TicketObj,Content => $cf_value, );</p><p class="MsoNormal">return 1;</p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal">
Can someone point me in the right direction is the code I’m using even close?</p><p class="MsoNormal"> </p><p class="MsoNormal">Thanks in advance and let me know if you need more info,</p><p class="MsoNormal">Peter</p></div>
<p> </p>
<p> <img src="https://mail.google.com/mail/?ui=2&view=bsp&ver=ohhl4rw8mbn4" alt="" align="baseline" border="0" hspace="0"></p>
<p><font face="Arial"> <font color="#000000" size="4"><b>Peter Nugent</b></font> <font color="#c0c0c0">| Technical Director | +353 (0) 45-531262 | +353 (0) 45-940522</font></font></p>
<p><font color="#c0c0c0" face="Arial">Leinster Mills | Osberstown | Naas | Co. Kildare | Ireland | <a href="mailto:peter.nugent@hetg.ie" target="_blank">peter.nugent@hetg.ie</a> |<font color="#000000"> </font><font color="#ac17d7"><a href="http://www.hetg.ie" target="_blank">www.hetg.ie</a></font></font></p>
<p><font color="#c0c0c0" face="Arial"></font> </p>
<p>
</p><hr>
<p></p>
<p><span style="font-size: 10pt; color: green;"><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> </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></p>
<p></p></div>
</blockquote></div><br>