Disable AddNote notification

Moderator: crythias

Locked
sindrej
Znuny newbie
Posts: 9
Joined: 11 Mar 2011, 11:24
Znuny Version: 3.0.6

Disable AddNote notification

Post by sindrej »

How can i disable the "AddNote" notification message that is sent to agents when someone adds a note to a ticket they are the owner of?

Can i just comment out the following in "Article.pm"?

Code: Select all

   # send agent notification on adding a note
    elsif ( $Param{HistoryType} =~ /^AddNote$/i ) {

        # send notification to owner/responsible/watcher
        my @UserIDs = $Ticket{OwnerID};
        if ( $Self->{ConfigObject}->Get('Ticket::Responsible') ) {
            push @UserIDs, $Ticket{ResponsibleID};
        }
        push @UserIDs, $Self->TicketWatchGet(
            TicketID => $Param{TicketID},
            Notify   => 1,
            Result   => 'ARRAY',
        );
        for my $UserID (@UserIDs) {
            next if !$UserID;
            next if $UserID == 1;
            next if $UserID eq $Param{UserID};

            # do not send to this user
            next if $DoNotSend{$UserID};

            # check if alreay sent
            next if $AlreadySent{$UserID};

            # remember already sent info
            $AlreadySent{$UserID} = 1;

            # do not send to this user (mute)
            next if $DoNotSendMute{$UserID};

            # send notification
            $Self->SendAgentNotification(
                Type                  => $Param{HistoryType},
                RecipientID           => $UserID,
                CustomerMessageParams => {%Param},
                TicketID              => $Param{TicketID},
                Queue                 => $Param{Queue},
                UserID                => $Param{UserID},
            );
        }
    }
Version: 3.0.6
Running on: Windows 2003 Server with MySQL
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Disable AddNote notification

Post by crythias »

Please adjust your signature to tell us your version.
If you want to permanently do it, just add next after for:

Code: Select all

        for my $UserID (@UserIDs) {
            next if true; 
            next if !$UserID;
This turns off notification for add note for everyone, by the way.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
sindrej
Znuny newbie
Posts: 9
Joined: 11 Mar 2011, 11:24
Znuny Version: 3.0.6

Re: Disable AddNote notification

Post by sindrej »

crythias wrote:Please adjust your signature to tell us your version.
If you want to permanently do it, just add next after for:

Code: Select all

        for my $UserID (@UserIDs) {
            next if true; 
            next if !$UserID;
This turns off notification for add note for everyone, by the way.

Thank you for your reply.

I want to disable the notification for everyone so I will try what you have suggested.

I've also updated my signature :)
Version: 3.0.6
Running on: Windows 2003 Server with MySQL
sindrej
Znuny newbie
Posts: 9
Joined: 11 Mar 2011, 11:24
Znuny Version: 3.0.6

Re: Disable AddNote notification

Post by sindrej »

Adding:

Code: Select all

next if true;
caused OTRS not to start with the following error: "Bareword "true" not allowed while "strict subs" in use..."

So i tried with:

Code: Select all

next if 1 == 1
That seems to work.
Version: 3.0.6
Running on: Windows 2003 Server with MySQL
coldrums
Znuny newbie
Posts: 5
Joined: 05 Jun 2012, 19:04
Znuny Version: 3.1.5

Re: Disable AddNote notification

Post by coldrums »

Sorry to bump an old ticket, but I think it's relevant to the following question: is it possible to enable the 'AddNote' notification for all agents with rw permissions on the ticket?(members of the queue which the ticket belongs to)

Thank you very much!
OTRS 3.1.5, ITSM 3.1.3 on Debian
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Disable AddNote notification

Post by crythias »

coldrums wrote: I think it's relevant to the following question:
This topic is about disabling AddNote notifications permanently.
coldrums wrote:is it possible to enable the 'AddNote' notification for all agents with rw permissions on the ticket?(members of the queue which the ticket belongs to)
The lock status of the ticket determines the answer to your question.
If the ticket is locked and a non-owner agent adds a note, the owner of the ticket gets notification.
If the ticket is unlocked and an agent adds a note, all rw in the queue except the submitter of the note get notification. (IIRC)
This is what the topic was attempting to prevent.

If you want to do what you ask regardless of Lock status, you'll either create a Notification Event (which will duplicate messages based upon the above statement), modify the code to ignore the lock status, or modify the code as within this topic and using Notification (Event) as the only way to send the appropriate email.

Also, a simple "next;" may have been sufficient for my previous entry.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
coldrums
Znuny newbie
Posts: 5
Joined: 05 Jun 2012, 19:04
Znuny Version: 3.1.5

Re: Disable AddNote notification

Post by coldrums »

Thanks for your answer and I'm sorry if my post was off-topic (please suggest whether I should create a new topic when the question isn't directly related to a previous post, I'm really new to the forums).

Going back to the topic, we are getting AddNote notifications only for the owner of a ticket, independently of the lock status of the ticket. By looking at the following code (Article.pm), I assume only owner, responsible and watcher agents get notified (we have Ticket->Core::TicketWatcher::Ticket::Watcher and Ticket->Core::Ticket::Ticket::Responsible set to 'No'):

Code: Select all

# send agent notification on adding a note
    elsif ( $Param{HistoryType} =~ /^AddNote$/i ) {

        # send notification to owner/responsible/watcher
        my @UserIDs = $Ticket{OwnerID};
        if ( $Self->{ConfigObject}->Get('Ticket::Responsible') ) {
            push @UserIDs, $Ticket{ResponsibleID};
        }
        push @UserIDs, $Self->TicketWatchGet(
            TicketID => $Param{TicketID},
            Notify   => 1,
            Result   => 'ARRAY',
        );
I'm interested in modifying this code so members (rw) of the queue the ticket belongs to get notified also.

Disabling all the notifications (as stated in this topic) and working through Notifications (Event) is a perfect option too, but is it possible to modify Article.pm to enable the needed notifications?

Thank you very much!
OTRS 3.1.5, ITSM 3.1.3 on Debian
Locked