[rt-users] Custom Scrip Failing (using example from RT Essentials) and User Details not accessible

Ken Crocker kfcrocker at lbl.gov
Thu Aug 6 12:09:31 EDT 2009


Mike,

I understand your frustration. I'm not familiar with that scrip, nor do 
I usually write scrips that go against the USER Table. However, I was 
thinking about how I would do it and I would want to try something that 
captures the Requesors phone number at the time the ticket is created 
and stuff it into a Custom Field. That way whenever the ticket is looked 
at, the phone number could be displayed. An alternative of that would be 
to modify the ticket display code (make a local copy of 
/share/html/Ticket/Display.html) to display the Requestors phone when 
accessed. That way you would always get the current Requestor (in case 
it was changed after creation). I'm not sure, but if there is a 
$Self->TransactionObj and a $Self->TicketObj then perhaps there is also 
a $Self->UserObj that would allow you to get to the Users phone.
Perhaps there is someone out there that can pass on any of that kind of 
knowledge.

Kenn
LBNL


On 8/5/2009 10:31 PM, Michael Ellis wrote:
> 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.
>  
> 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.
>  
> The customized scrip is:
>  
> 1    my $email = ($self->TicketObj->RequestorAddresses)[0];
> 2   
> 3   my $ldap = Net::LDAP->new( 'someserver.umanitoba.ca' );
> 4    $ldap->bind;
> 5   
> 6    my $msg = $ldap->search( base   => 'o="University of 
> Manitoba,c="ca"',
> 7                            filter => "(mail=$email)",
> 8                           );
> 9    
> 10    my $entry = $msg->entry(0);
> 11  
> 12    my $phone= $entry->get_value('telephoneNumber');
> 13   
> 14    my $cf = RT::CustomField->new( $RT::SystemUser );
> 15    $cf->LoadByName( Name => 'RequestorPhone' );
> 16    
> 17    $self->TicketObj->AddCustomFieldValue( Field => $cf, Value => 
> $phone);
> 18    
> 19    return 1;
>  
> Changes from the original are
> 3 Server
> 6 Base
> 7 email -> mail (what our non-standard ldap calls it)
> 12 $dept -> $phone
> 15 my custom field
> 17 $dept -> $phone
>  
> The custom field RequestorPhone is not being set, though. RT's debug 
> log shows the entry:
>  
> [error]: Scrip 16 Prepare failed: Can't call method "get_value" on an 
> undefined value at (eval 8643) line 12.
>  
> Could someone help me get this working, or share what they have done?
>  
> 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:
>  
> "Time to display: 0.009515
>  
> »|« RT 3.8.4 Copyright 1996-2009 Best Practical Solutions, LLC."
>  
> Root/Superuser is taken to the requestor's details.
>  
> 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.
>  
> 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.
>  
> TIA,
>  
> Mike
> ------------------------------------------------------------------------
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090806/bb6376e5/attachment.htm>


More information about the rt-users mailing list