What object would I use to reference the requestor’s full name in an
autoreply template?
If the requestor sends in an email, $Transaction->CreatorObj->RealName works
fine, but if I created a ticket
for the requestor via the web, this obviously won’t work. Thanks!
-matt
Matthew Hanley
mhanley@cxtec.com
What object would I use to reference the requestor’s full name in an
autoreply template?
If the requestor sends in an email, $Transaction->CreatorObj->RealName works
fine, but if I created a ticket
for the requestor via the web, this obviously won’t work. Thanks!
I believe it’s just $Ticket->CreatorObj->RealName.
Andy Harrison
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.
signature.asc (253 Bytes)
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;
}
What object would I use to reference the requestor’s full name in an
autoreply template?
I believe it’s just $Ticket->CreatorObj->RealName.
Unfortunately, that just gives you the real name of the ticket creator, not
requestor.
Ruslan - your code worked perfectly, thank you.
Can anyone tell me how to differentiate a ticket created via an incoming
email as opposed to via the web?
-matt
Matthew Hanley
mhanley@cxtec.com
Matt Hanley wrote:
What object would I use to reference the requestor’s full name in an
autoreply template?
I believe it’s just $Ticket->CreatorObj->RealName.
Unfortunately, that just gives you the real name of the ticket creator, not
requestor.
Ruslan - your code worked perfectly, thank you.
Can anyone tell me how to differentiate a ticket created via an incoming
email as opposed to via the web?
Yeah, only with headers hack:
$ftr = $TicketObj->Transactions->First;
if($ftr && $ftr->id) {
my $attachments = $ftr->Attachments;
while( my $a = $attachments->Next ) {
return ‘email’ if( $a->GetHeader(‘Received’) );
}
}
return ‘other’;
This code return scalar ‘email’ if ticket was created via email.