Keep state on followup

Moderator: crythias

Locked
griffin
Znuny newbie
Posts: 20
Joined: 29 Apr 2015, 19:51
Znuny Version: 3.3.8
Real Name: Marcos

Keep state on followup

Post by griffin »

Hi,
i know this has been answered before in this topic viewtopic.php?f=62&t=6066 but i cant seem to get it to work. Currently im working on OTRS 4.0.8

Here´s what I´ve done:

Modified FollowUp.pm with (i reversed the changes but left it commented out)

Code: Select all

    my $State = $ConfigObject->Get('PostmasterFollowUpState') || 'open';
    if (
        $Ticket{StateType} =~ /^close/
        && $ConfigObject->Get('PostmasterFollowUpStateClosed')
        )
    {
        $State = $ConfigObject->Get('PostmasterFollowUpStateClosed');
		#$State = $Ticket{State};
    }
    
Used the following on ZZZAuto.pm
$Self->{'PostmasterFollowUpState'} = '$Ticket{State}';
$Self->{'PostmasterFollowUpStateClosed'} = 'closed';

Modified Followup.pm

Code: Select all

    #my $State = $ConfigObject->Get('PostmasterFollowUpState') || 'open';
	
	my $State = $Ticket{State};
With any and all these changes, the state still changes.
All the state types are closed. Doesn't matter if its closed successful or unsuccesful or a new state of type closed. They all seem to reopen the ticket and i want to allow follow ups from the user but no state change on the followup.

Any ideas as what to do?
OTRS: 4.0.8
Database: MySQL
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Keep state on followup

Post by crythias »

https://github.com/OTRS/otrs/blob/rel-4 ... Up.pm#L123

Code: Select all

    my $State = $ConfigObject->Get('PostmasterFollowUpState') || 'open';
    if (
        $Ticket{StateType} =~ /^close/
        && $ConfigObject->Get('PostmasterFollowUpStateClosed')
        )
    {
        $State = $ConfigObject->Get('PostmasterFollowUpStateClosed');
    }
    if ( $GetParam{'X-OTRS-FollowUp-State'} ) {
        $State = $GetParam{'X-OTRS-FollowUp-State'};
    }

    if ( $Ticket{StateType} !~ /^new/ || $GetParam{'X-OTRS-FollowUp-State'} ) {
        $TicketObject->TicketStateSet(
            State => $GetParam{'X-OTRS-FollowUp-State'} || $State,
            TicketID => $Param{TicketID},
            UserID   => $Param{InmailUserID},
        );
        if ( $Self->{Debug} > 0 ) {
            print "State: $State\n";
        }
    }
New states (state-type begins with new) keeps the state on email followup.

Note that closed states are handled by the Admin, Queue settings:
possible (reopens the ticket),
new ticket (creates a new ticket),
reject (actually keeps the state closed).
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
Locked