[rt-users] Putting requestor's real name in the autoreply?

Ruslan U. Zakirov Ruslan.Zakirov at acronis.com
Mon Jan 17 10:20:49 EST 2005


Rick Russell wrote:
> 
> 
> Matt Hanley wrote:
> 
>> What object would I use to reference the requestor's full name in an
>> autoreply template?
> 
> 
> my $Ticket = $self->TicketObj;
> 
> if ($Ticket -> Requestors->UserMembersObj->First->Id) {
> 
>     my $UserObj = RT::User->new( $RT::SystemUser );
> 
>     $UserObj->Load( $Ticket -> Requestors->UserMembersObj->First->Id );
> 
>     my $RealName = $UserObj->RealName; }
> 
> Rick R.
Rick, this is code for scrip in template you should use $Ticket, to get 
ticket object not $self->TicketObj.

So template code would be:
{
	my $OUT = '';
	my $UserObj = $Ticket->Requestors->UserMembersObj->First;
	if ($UserObj && $UserObj->id) {
		$OUT .= $UserObj->RealName;
	}
	$OUT;
}



More information about the rt-users mailing list