<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7100.4129"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Calibri>Although there might be better ways of doing this, the
reason this scrip wasn't working is simply some wrongly placed quote marks in
like 6. Fixed and it works. That's what I get for trying to work at after
midnight.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>-Mike</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=michael_ellis@umanitoba.ca
href="mailto:michael_ellis@umanitoba.ca">Michael Ellis</A> </DIV>
<DIV><B>Sent:</B> Thursday, August 06, 2009 12:31 AM</DIV>
<DIV><B>To:</B> <A title=RT-Users@lists.bestpractical.com
href="mailto:RT-Users@lists.bestpractical.com">RT-USERS</A> </DIV>
<DIV><B>Subject:</B> [rt-users] Custom Scrip Failing (using example from RT
Essentials)and User Details not accessible</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=Calibri>One of the biggest complaints from my privileged users
during our testing of RT is that the requestor's phone number is not presented
to them conveniently. We currently handle the bulk of our support by phone, so
some of them are standing at my office door with torches and
pitchforks.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>To rectify this I am trying to implement the custom
scrip found on page 81 of the RT Essentials book, and customize it to pull up
phone numbers instead of departments.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>The customized scrip is:</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>1 my $email =
($self->TicketObj->RequestorAddresses)[0];<BR>2 </FONT></DIV>
<DIV><FONT face=Calibri>3 my $ldap = Net::LDAP->new(
'someserver.umanitoba.ca' );<BR>4
$ldap->bind;<BR>5 <BR>6 my $msg =
$ldap->search( base => 'o="University of
Manitoba,c="ca"',<BR>7
filter =>
"(mail=$email)",<BR>8
);<BR>9 <BR>10 my $entry =
$msg->entry(0);<BR>11 <BR>12 my $phone=
$entry->get_value('telephoneNumber');<BR>13
<BR>14 my $cf = RT::CustomField->new( $RT::SystemUser
);<BR>15 $cf->LoadByName( Name => 'RequestorPhone'
);<BR>16 <BR>17
$self->TicketObj->AddCustomFieldValue( Field => $cf, Value =>
$phone);<BR>18 <BR>19 return
1;</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Changes from the original are</FONT></DIV>
<DIV><FONT face=Calibri>3 Server</FONT></DIV>
<DIV><FONT face=Calibri>6 Base</FONT></DIV>
<DIV><FONT face=Calibri>7 email -> mail (what our non-standard ldap calls
it)</FONT></DIV>
<DIV><FONT face=Calibri>12 $dept -> $phone</FONT></DIV>
<DIV><FONT face=Calibri>15 my custom field</FONT></DIV>
<DIV><FONT face=Calibri>17 $dept -> $phone</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>The custom field RequestorPhone is not being set,
though. RT's debug log shows the entry:</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>[error]: Scrip 16 Prepare failed: Can't call method
"get_value" on an undefined value at (eval 8643) line 12.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Could someone help me get this working, or share what
they have done?</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Secondly, I am having an issue that when my privileged
users click on a requestor in the people tab of a ticket, they are presented
with:</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>"Time to display: 0.009515</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>»|« RT 3.8.4 Copyright 1996-2009 Best Practical
Solutions, LLC."</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Root/Superuser is taken to the requestor's
details.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>So right now, my people have no way to obtain the
requestor's phone number from within RT. So what are they doing is falling back
to our old helpdesk system and in frustration entering the calls there. This is
jeopardizing the acceptance and adoption of RT as a replacement for our old
system.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I'm sure that I've made one or two (or more) simple
errors and wish I could spend more time looking into this before going to the
forum, but the townspeople are at the castle gates.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>TIA,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Mike</FONT></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users<BR><BR>Community
help: http://wiki.bestpractical.com<BR>Commercial support:
sales@bestpractical.com<BR><BR><BR>Discover RT's hidden secrets with RT
Essentials from O'Reilly Media. <BR>Buy a copy at
http://rtbook.bestpractical.com</BODY></HTML>