OTRS - change tickets history showing in new ticket based on customer User not Customer ID

1.2k Views Asked by At

I would like to change the tickets history that is showing when you start to create a new ticket based on the customer user that is starting the ticket creation and not on the Customer ID as is the default. Any guidance? Thank you.

2

There are 2 best solutions below

0
On BEST ANSWER

Do you mean the open tickets that show on the right-hand side, in the Customer Information box? You can add history for the customer login rather than the customer ID by enabling Frontend::CustomerUser::Item###16-OpenTicketsForCustomerUserLogin and disabling Frontend::CustomerUser::Item###15-OpenTickets in SysConfig.

If you'd mean the list of tickets that is shown on the bottom of the screen, the limitation to searching by customerid is unfortunately hard-coded in AgentCustomerSearch.pm so changing that would need code changes.

0
On

In

...otrs/Kernel/Modules/AgentCustomerSearch.pm

in this block of code (around line 250),

Add: CustomerUserLoginRaw => $CustomerUserID

Comment out: CustomerIDRaw => @CustomerIDs,

It should look like this:

my @ViewableTickets;
if (@CustomerIDs) {
    @ViewableTickets = $TicketObject->TicketSearch(
        Result        => 'ARRAY',
        Limit         => 250,
        SortBy        => [$SortBy],
        OrderBy       => [$OrderBy],
        # CustomerIDRaw => \@CustomerIDs,
        CustomerUserLoginRaw => $CustomerUserID,
        UserID        => $Self->{UserID},
        Permission    => 'ro',
    );
}