[SOLVED]Configure no state change on FollowUp

Moderator: crythias

Post Reply
Herr_K
Znuny newbie
Posts: 8
Joined: 29 Jul 2009, 09:11
Znuny Version: 3.0.8

[SOLVED]Configure no state change on FollowUp

Post by Herr_K »

Hello OTRS community,

I do not want Tickets to get re-opened every time a user sends a "Thank You, it works" as an answer to my Ticket response. Prior to updating to v3 this could be accomplished by setting 'Ticket -> Core::PostMaster -> PostmasterFollowUpStateClosed' to 'closed'. Since I use v3, this does not work any more. Setting PostmasterFollowUpStateClosed to 'closed' is not possible any more, as it will only acceppt 'closed successful' or 'closed unsuccsessful'. Unfortunately this obvioiusly won't produce the behaviour I am intending.

How can I disable any state change for follow ups via email? I already tried commenting out the whole "#set state"-section in Kernel/System/PostMaster/followUp.pm. While this leads to the desired effect, that the ticket state remains unchanged, it also prevents AgentFollowUpNotifications from being sent (a corellation which I don't understand at all).

Does anyone have a hint?
Last edited by Herr_K on 24 Aug 2011, 18:44, edited 1 time in total.
OTRS 3.0.8 and MySQL on Win2003 R2
ITSM 3.0.4
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Configure no state change on FollowUp when state is 'clo

Post by crythias »

Yes.
http://forums.otrs.org/viewtopic.php?f= ... 221#p39971 talks about this for normal states.

Code: Select all

    <ConfigItem Name="PostmasterFollowUpStateClosed" Required="0" Valid="0">
        <Description Translatable="1">Defines the state of a ticket if it gets a follow-up and the ticket was already closed.</Description>
        <Group>Ticket</Group>
        <SubGroup>Core::PostMaster</SubGroup>
        <ValidateModule>Kernel::System::SysConfig::StateValidate</ValidateModule> <-- Remove this line
        <Setting>
            <String Regex="">open</String>
        </Setting>
    </ConfigItem>
Backup Ticket.xml, remove the ValidateModule line, save it.
in SysConfig, type $Ticket{State} instead of open.
Save it.

Let me know if this works or doesn't.

Edit: "closed" isn't a state. It's a state type. That's why it didn't validate.
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
Herr_K
Znuny newbie
Posts: 8
Joined: 29 Jul 2009, 09:11
Znuny Version: 3.0.8

Re: Configure no state change on FollowUp when state is 'clo

Post by Herr_K »

That seems to be a reasonable way. Putting $Ticket{State} in PostmasterFollowUpStateClosed works after removing the line from Ticket.xml. The state now remains unchanged after a follow up as well but again no agent notification is sent. otrs.log says:

Code: Select all

Wed Aug 24 16:56:39 2011][Error][Kernel::System::State::StateGet][247] State '$Ticket{State}' not found!
[Wed Aug 24 16:56:39 2011][Error][Kernel::System::Ticket::TicketStateSet][5526] Need StateID or State!
[Wed Aug 24 16:56:39 2011][Notice][Kernel::System::PostMaster::FollowUp::Run] FollowUp Article to Ticket [2011082310000108] created (TicketID=5635, ArticleID=23579). ,[Wed Aug 24 16:56:39 2011][Notice][Kernel::System::MailAccount::POP3::Fetch] POP3: Fetched 1 email(s) from helpdesk/mail.mydomain.local.
OTRS 3.0.8 and MySQL on Win2003 R2
ITSM 3.0.4
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Configure no state change on FollowUp when state is 'clo

Post by crythias »

That means it's apparently not working.

Then you might want to modify Kernel/System/PostMaster/FollowUp.pm file
http://forums.otrs.org/viewtopic.php?f=62&t=6066

Code: Select all

    my $State = $Self->{ConfigObject}->Get('PostmasterFollowUpState') || 'open';
    if (
        $Ticket{StateType} =~ /^close/
        && $Self->{ConfigObject}->Get('PostmasterFollowUpStateClosed')
        )
    {
        #comment or remove this $State = $Self->{ConfigObject}->Get('PostmasterFollowUpStateClosed');
        $State = $Ticket{State};
    }
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
Herr_K
Znuny newbie
Posts: 8
Joined: 29 Jul 2009, 09:11
Znuny Version: 3.0.8

Re: Configure no state change on FollowUp when state is 'clo

Post by Herr_K »

Ok. I reversed the changes in Ticket.xml, edited the FollowUp.pm accordingly and set PostmasterFollowUpStateClosed back to 'open' in the config (which should not do anything either after the changes done to FollowUp.pm, if I understand correctly).

Again, closed Tickets remain closed on a FollowUp but no AgentNotification is being sent.

This time I don't get any errors in otrs.log though.

But I don't quite understand, what requirements must be met for a notification to be sent. If I get a FollowUp for an open Ticket now, notifiacations are being sent, btw.
OTRS 3.0.8 and MySQL on Win2003 R2
ITSM 3.0.4
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Configure no state change on FollowUp when state is 'clo

Post by crythias »

Kernel/System/Ticket/Article.pm will not send a notification if the ticket is closed

Code: Select all

sub SendAgentNotification {
...
    return if $Ticket{StateType} eq 'closed'; #line 2204

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
Herr_K
Znuny newbie
Posts: 8
Joined: 29 Jul 2009, 09:11
Znuny Version: 3.0.8

Re: Configure no state change on FollowUp when state is 'clo

Post by Herr_K »

Indeed. After commenting out that line, everything seems to work like intended for me. Thank you! This was bugging me all day long.

(Although I am wondering, how this all (including notifications for closed tickets) worked in v2.3.4 just by putting "closed" into PostmasterFollowUpStateClosed.)
OTRS 3.0.8 and MySQL on Win2003 R2
ITSM 3.0.4
sciolto
Znuny newbie
Posts: 16
Joined: 04 Oct 2010, 09:19
Znuny Version: 2.4.7

Re: [SOLVED]Configure no state change on FollowUp

Post by sciolto »

Hi I had a similar request from a customer:

"Accept follow ups only for open tickets, create a new ticket from follow up on closed tickets".

All I did was change a boolean AND in an OR:

~[otrs]/Kernel/System/Postmaster.pl:~268

Change this:

Code: Select all

if ( $FollowUpPossible =~ /new ticket/i && $State{TypeName} =~ /^close/i ) {
To this:

Code: Select all

if ( $FollowUpPossible =~ /new ticket/i || $State{TypeName} =~ /^close/i ) {
:o
Several OTRS 2.4 and 3.0 installations. All on CentOS /w Apache & MySql.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [SOLVED]Configure no state change on FollowUp

Post by crythias »

You don't need to do that. Just change the queue settings.

If the followup type is new ticket AND the ticket is closed, it creates a new ticket. That's supposed to happen. Otherwise the followup type in the queue is "possible" if you want to follow up on closed ticket.
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
sciolto
Znuny newbie
Posts: 16
Joined: 04 Oct 2010, 09:19
Znuny Version: 2.4.7

Re: [SOLVED]Configure no state change on FollowUp

Post by sciolto »

crythias wrote:You don't need to do that. Just change the queue settings.

If the followup type is new ticket AND the ticket is closed, it creates a new ticket. That's supposed to happen. Otherwise the followup type in the queue is "possible" if you want to follow up on closed ticket.
But if the queue setting is "new ticket", there won't be no follow up on any ticket in the queue right? I need follow ups to be possible only for open tickets (or better: not for closed tickets).
Several OTRS 2.4 and 3.0 installations. All on CentOS /w Apache & MySql.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [SOLVED]Configure no state change on FollowUp

Post by crythias »

sciolto wrote:But if the queue setting is "new ticket", there won't be no follow up on any ticket in the queue right? I need follow ups to be possible only for open tickets (or better: not for closed tickets).
In a word, No.

I have two sources for my response. The words
"Specifies if follow up to closed tickets would re-open the ticket, be rejected or lead to a new ticket."
and the code you modified.
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
SultanOfSwing
Znuny newbie
Posts: 22
Joined: 06 Nov 2013, 18:30
Znuny Version: 4.0.10
Real Name: Fabian
Company: Company

Re: [SOLVED]Configure no state change on FollowUp

Post by SultanOfSwing »

Hi,

I was wondering if the problem with the "PostmasterFollowUpStateClosed" option has been fixed or if there is a more update-friendly way to set this up without fiddeling with the .pm-files.

What I want is the following:
I also want what Herr_K wants and that is not to have thank-you-mails mess up my ticket-states, but I still want my users to reopen a ticket via the customer-web-interface.
After quite a bit of research I found the "PostmasterFollowUpStateClosed" option today only to find that when I set it to "closed successful" (we don't do fancy statistics where we distinguish between successful and unsuccessful) and set the queue to followup possible that it still reopens the ticket.

Is there a more elegant way to do this?
OTRS 3.3.8
MySQL 5.5
Debian 7.4 64bit
FAQ- + Support-Package
Post Reply