[SOLVED] Enable notes to reset Escalation Last Update Time

English! place to talk about development, programming and coding
Post Reply
rodolfor
Znuny newbie
Posts: 89
Joined: 11 Jun 2020, 14:56
Znuny Version: 6.0.27
Real Name: Rodolfo Rughi
Company: none

[SOLVED] Enable notes to reset Escalation Last Update Time

Post by rodolfor »

I want to consider EACH article of a ticket, able to reset Last Update Escalation Time.
Also a note added by a generic agent job.

In version 6.0.29,
in sub TicketEscalationIndexBuild of Ticket.pm
after line 2706, after

Code: Select all

for my Row ( reverse @SendeHistory ) {
I addedd:

Code: Select all

   $LastSenderTime = $Row->{Created};
   $LastSenderType = 'customer';
   last ROW;
But nothing happens.
Is the correct point where put the modification?
Where are I'm wrong?

Thanks
Last edited by rodolfor on 12 Nov 2020, 19:25, edited 1 time in total.
rodolfor
Znuny newbie
Posts: 89
Joined: 11 Jun 2020, 14:56
Znuny Version: 6.0.27
Real Name: Rodolfo Rughi
Company: none

Re: Enable notes to reset Escalation Last Update Time

Post by rodolfor »

Well, this is possible modifying the Ticket.pm code.

At line 2680 (6.0.29) there is the loop where otrs detect the last article to use for calculate Last Update Time.
Then I must comment this line:

Code: Select all

 # do not use internal articles for calculation
            next ROW if !$Row->{IsVisibleForCustomer};

The line "next ROW" is used to skip articles that are not visible to customers (such as notes)
Commenting line with next ROW, we consider this articles.

The next step is to used to ensure that Notes also remove "First response Time" from ticket zoom:

Code: Select all

    # check if first response is already done
    return if !$DBObject->Prepare(
        SQL => '
            SELECT a.create_time,a.id FROM article a, article_sender_type ast
            WHERE a.article_sender_type_id = ast.id
                AND a.ticket_id = ?
                AND ast.name = ?
                AND a.is_visible_for_customer = ?
            ORDER BY a.create_time',
        Bind  => [ \$Param{TicketID}, \'agent', \1],
        Limit => 1,
    );
You can see that the sql where, filter only articles visible for customer, with "AND a.is_visible_for_customer = 1" (merging the sql and the parameter binding).

If we remove this lines we do the trick:

Code: Select all

    # check if first response is already done
    return if !$DBObject->Prepare(
        SQL => '
            SELECT a.create_time,a.id FROM article a, article_sender_type ast
            WHERE a.article_sender_type_id = ast.id
                AND a.ticket_id = ?
                AND ast.name = ?
            ORDER BY a.create_time',
        Bind  => [ \$Param{TicketID}, \'agent'],
        Limit => 1,
    );
Post Reply