Hi,

I use OTRS 3.3.7 but from what I saw on github the problem is also present
in 4.x.

Problem: When an event notification (ADMIN->Notifications (Event)) with
<OTRS_AGENT_BODY[10]> in its text is fired, if the latest article added by
an agent is an internal note, then the body of the generated notification
email will contain the first 10 lines of the internal note.

Seeing how these notifications are registered in history as
SendCustomerNotification, then it's very debatable they should have access
to internal notes at all.

Repro steps:
1. Configure an event notification triggered when ticket state is changed,
to be sent to the customer or an arbitrary email address, with article body
containing <OTRS_AGENT_BODY[10]>
2. Customer posts a new ticket (state is "new")
3. Agent posts an internal note (state is not changed)
4. Customer adds an article to the ticket and changes the state from "new"
to "open" => email notification is sent to customer containing lines from
the internal note

Is the problem correctly identified? Is there a workaround?

/bogdan

P.S: Here is the relevant code from v3.3.7,
Kernel\System\Ticket\Event\NotificationEvent.pm, line 725:

All articles are retrieved in @ArticleBoxAgent and then the latest one sent
by an agent is taken in %ArticleAgent, regardless of whether or not it's an
internal note.

    # latest customer and agent article
    my @ArticleBoxAgent = $Self->{TicketObject}->ArticleGet(
        TicketID      => $Param{TicketID},
        UserID        => $Param{UserID},
        DynamicFields => 0,
    );
    my %ArticleAgent;
    for my $Article ( reverse @ArticleBoxAgent ) {
        next if $Article->{SenderType} ne 'agent';
        %ArticleAgent = %{$Article};
        last;
    }
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to