Show Ticket Title in Customer Interface

From OtterHub - OTRS Community Wiki
Jump to: navigation, search

On the OTRS Customer Interface in the Ticket Overview, by default the Last Article Subject instead of the Ticket Title is displayed.

This can be really confusing for the customer, because the Last Article Subject changes during the lifetime of a ticket. And, for instance, in case the customer adds a reply to a ticket via the customer interface, he has to specify both a subject and a body. This subject will then be used in the ticket overview. So if the customer adds an article with subject 'Followup', this will be the description for the ticket displayed in the overview.

To display the Ticket Title in the overview instead of the last article subject, you should make this change to the last lines of the file Kernel/Modules/CustomerTicketOverview.pm :

    # customer info (customer name)
    if ( $Article{CustomerUserID} ) {
        $Param{CustomerName}
            = $Self->{CustomerUserObject}->CustomerName( UserLogin => $Article{CustomerUserID}, );
        $Param{CustomerName} = '(' . $Param{CustomerName} . ')' if ( $Param{CustomerName} );
    }

    # get ticket title
    my %Ticket = $Self->{TicketObject}->TicketGet( TicketID => $Param{TicketID} );

    # add block
    $Self->{LayoutObject}->Block(
        Name => 'Record',
        Data => {
            %Article,
#            Subject => $Subject,
            Subject => $Ticket{Title} || $Subject,
            %Param,
        },
    );
}

The actual part that is added is the section that says "get ticket title" as well as the Subject parameter added to the layout object.






If you want to change this also for the Customer Search Results, you should make these changes to some lines in the File Kernel/Modules/CustomerTicketSearch.pm :

                   # customer info string
                   $Data{CustomerName} = '(' . $Data{CustomerName} . ')'
                       if ( $Data{CustomerName} );
                       
                   # get ticket title
                   my %Ticket = $Self->{TicketObject}->TicketGet( TicketID => $Data{TicketID} );
                   
                   # add blocks to template
                   $Self->{LayoutObject}->Block(
                       Name => 'Record',
                       Data => {
                           %Data,
                   #       Subject => $Subject,
                           Subject => $Ticket{Title} || $Subject,
                           %UserInfo,
                       },
                   );
               }
           }
       }