[rt-users] Ticket owners not always showing in search results

Alex Hall ahall at autodist.com
Mon Nov 7 11:16:31 EST 2016


Sorry for all the messages today.

My boss just pointed out something odd: our script to make a ticket
requestor into the owner works fine, in that viewing the ticket shows the
owner. However, a search that turns up multiple tickets will have many
owners listed as "nobody in particular". Clicking such a ticket reveals an
owner, though. Why would the search sometimes refuse to show the owner,
while the ticket page lists one? I haven't modified the results page at
all, and while I did modify the ticket display some, I never touched the
part that shows the owner. Here's the script (I didn't write it, I borrowed
it):


# get actor ID
my $Actor = $self->TransactionObj->Creator;
#if actor is RT_SystemUser then get out of here
return 1 if $Actor == $RT::SystemUser->id;
#prevents a ticket being assigned to an unprivileged user, comment out if
you want this
return 1 unless $self->TransactionObj->CreatorObj->Privileged;
#get out unless ticket owner is nobody
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
#try to change owner
$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user
#". $Actor );
my ($status, $msg) = $self->TicketObj->_Set(Field => 'Owner', Value =>
$Actor, RecordTransaction => 0);
unless( $status ) {
    $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );
    return undef;
}

return 1;

-- 
Alex Hall
Automatic Distributors, IT department
ahall at autodist.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20161107/80a97487/attachment.htm>


More information about the rt-users mailing list