[SOLVED] How to prevent a closed ticket to reopen?

Moderator: crythias

Post Reply
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

[SOLVED] How to prevent a closed ticket to reopen?

Post by HervE »

Hello,

In some cases, we need to close a ticket because it is not up to us to answer it.
However, our e-mail address may be kept in Cc of the exchanged mails on the topic ...which will cause the ticket to be re-opened.

How can I prevent it?

Regards,
HervE
Last edited by HervE on 06 Apr 2011, 10:09, edited 1 time in total.
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to prevent a closed ticket to reopen?

Post by crythias »

http://forums.otrs.org/viewtopic.php?f=61&t=5392 (Set next ticket state after closed ticket to 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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: How to prevent a closed ticket to reopen?

Post by HervE »

Thank you.
Very interesting and I will keep an eye on this.

However, I'm afraid I want to do something more tricky because I don't want an unconditional treatment.

Actually there are 2 cases we need to distinguish:
1. We agents have the 'lead' on the ticket. Then we want a closed ticket to be reopened if a customer replies - i.e. the default treatment in OTRS.
2. We don't have the lead on the ticket: either we forwarded it to an external team, or the external team that handles the tickets keeps us in Cc for information. Then we don't want a closed ticket to be reopened - except manually, if needed.

How to do?
-The 1st idea was to set tickets of case 2 to "closed" and keep them in this state, whatever arrives. But then how to do conditional reopening for case 1?
-The 2nd idea is to create another state (let's say, "external", or "reassigned") for tickets of case 2, and keep them in this state, whatever arrives. But which type for this state? Probably not "closed", I guess.
-Other ideas are to distinguish case 2 by a special lowest ticket priority, or to assign the ticket to a special dummy owner named "external" for instance...
-Another (better) idea?

Regards,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to prevent a closed ticket to reopen?

Post by crythias »

I'm trying to best guess this, too. You seem to be on the right track, but if you don't have control over the final state of the ticket...

1) is the external team external to your company and installation of OTRS (could external be another queue on OTRS?)
2) Is it possible to tell a customer to use the web portal to open the ticket? (Probably not, but ...)
3) Because all inbound emails to OTRS are considered non-agent emails (Yes, it's true.) there isn't a direct way to say, "Customer Response Only" ... as far as I can tell. There is a way to block new tickets from customers who aren't in your database. It doesn't help this case, though.

I'm leaning toward you setting a ticket state of "Pending Response" or "External waiting" of type open or pending. Still, any response to the ticket will set the ticket to "open" regardless of who sends the email. Best bet: don't cc the otrs system's email address when sending to the external handler. BCC might work if you're trying to log it.
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
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to prevent a closed ticket to reopen?

Post by crythias »

Another thought is to block the external email from doing anything via PostMaster Filter
Match: From external email address
Set: X-OTRS-Ignore Yes
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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: How to prevent a closed ticket to reopen?

Post by HervE »

Thank you for your answer.

1) The external team is definitely outside our OTRS (may it be from our company or not). I can create a specific queue, and then? Can the reopen functionality be conditioned by the ticket non-belonging to this specific queue?
2) We don't plan to give access to customers for the moment.
3) Customers are not necessarily in the database. (At go-live for instance they won't.) So we can't restrict the inbound emails to existing customers.

I think a specific state would be good. I will try and tell you.

We're probably not going to Cc OTRS system's email address when forwarding a ticket to external team, but external team, or customer, will probably reply all, including us (i.e. OTRS system) as Cc: (or maybe as To:)

Moreover, the external team handling their own incidents and requests may copy us when they think we have to know.

I am not sure how many email addresses have to be considered external teams, and I must not block them anyway, because sometimes they help us with our own tickets.

Regards,
HervE
Last edited by HervE on 30 Mar 2011, 09:05, edited 1 time in total.
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
cbravo
Znuny advanced
Posts: 113
Joined: 18 Nov 2010, 00:33
Znuny Version: 3.0

Re: How to prevent a closed ticket to reopen?

Post by cbravo »

I thought there was an option in sysconfig that allowed you to stop customers from openning tickets again. I know I at least read something like that somewhere. If I happen to find it again I'll let you know. I might need otrs to do this also so if I don't find it I'll try to change the files myself and let you know how it goes.
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: How to prevent a closed ticket to reopen?

Post by jojo »

It's the option "Follow up Option" in Queue settings
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to prevent a closed ticket to reopen?

Post by crythias »

@cbravo the problem is the Original Poster *wants* customers to be able to reopen tickets. He just doesn't want non-customers (third party ticket helpers who reply to all) to reopen tickets.

In essence, he's trying to get the ticket off his radar while the third party is supposed to handle the ticket. Apparently, this third party is the true endpoint of the ticket, though the third party doesn't have the ability to close tickets, either. Any correspondence the third party has shouldn't re-mark the ticket as open.
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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: How to prevent a closed ticket to reopen?

Post by HervE »

crythias wrote:In essence, he's trying to get the ticket off his radar while the third party is supposed to handle the ticket. Apparently, this third party is the true endpoint of the ticket, though the third party doesn't have the ability to close tickets, either. Any correspondence the third party has shouldn't re-mark the ticket as open.
Yes, this is what I (tried to) describe as case 2.

Bad news, I tried to create a specific state called "external", but it does not help.
First I tried it of state type "removed".
Second I tried it of state type "open".

In both, a follow-up mail made it switch to state "open", because it is the default state after a follow-up :( *

What can I do to manage it?

Regards,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to prevent a closed ticket to reopen?

Post by crythias »

viewtopic.php?f=62&t=6066 will keep the ticket state as-is on followup. Again, there is no built-in way to discriminate between a third party and a customer.
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
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to prevent a closed ticket to reopen?

Post by crythias »

I realize this is an old thread, but I don't recall if splitting the ticket for the third party to handle *separately* from the customer was considered.
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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: How to prevent a closed ticket to reopen?

Post by HervE »

Hello crythias,

Thank you for your answer.

After more usage I have a more precise idea of what I want.
When a new mail comes to a ticket:
-If ticket state is 'external', then keep it 'external'
-If ticket state is 'closed', then change it to 'open'.


Unfortunately, I didn't manage it, because I found no way to distinguish based on the current state of the ticket.
(And that's why I did not mark this thread as [SOLVED], by the way.)
If anybody thinks of a way to do it, or a workaround...? I am still interested!

For the moment, me and team thought it was "less dangerous" to stay with the original OTRS process - ticket always reopens - even though we may have to close it again.

Regards,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: How to prevent a closed ticket to reopen?

Post by HervE »

HervE wrote:When a new mail comes to a ticket:
-If ticket state is 'external', then keep it 'external'
I managed to do this in Kernel\System\PostMaster\FollowUp.pm:

Code: Select all

    # set state
    my $State = $Self->{ConfigObject}->Get('PostmasterFollowUpState') || 'open';
	# Added 'external' case (begin)
	if (
		$Ticket{State} =~ /^external/
		)
	{
		$State = /^external/;
	}	
	# Added 'external' case (end)
    if (
        $Ticket{StateType} =~ /^close/
        && $Self->{ConfigObject}->Get('PostmasterFollowUpStateClosed')
        )
    {
        $State = $Self->{ConfigObject}->Get('PostmasterFollowUpStateClosed');
    }
    if ( $GetParam{'X-OTRS-FollowUp-State'} ) {
        $State = $GetParam{'X-OTRS-FollowUp-State'};
    }

    if ( $Ticket{StateType} !~ /^new/ || $GetParam{'X-OTRS-FollowUp-State'} ) {
        $Self->{TicketObject}->TicketStateSet(
            State => $GetParam{'X-OTRS-FollowUp-State'} || $State,
            TicketID => $Param{TicketID},
            UserID   => $Param{InmailUserID},
        );
        if ( $Self->{Debug} > 0 ) {
            print "State: $State\n";
        }
    }
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [SOLVED] How to prevent a closed ticket to reopen?

Post by crythias »

minor thing:

Code: Select all

   if ( $Ticket{State} =~ /^external/ )  { $State = 'external'; }  
I think you might want to use a string instead of a regular expression. YMMV
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
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

Re: [SOLVED] How to prevent a closed ticket to reopen?

Post by HervE »

Yes, thanks.
(Provided it still passes through translation afterwards?)

Please forgive my poor knowledge in Perl and regular expressions :)

HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [SOLVED] How to prevent a closed ticket to reopen?

Post by crythias »

I realize this is old, but I'd change this (again) to:

Code: Select all

   if ( $Ticket{State} =~ /^external/ )  { $State = $Ticket{State}; } 
This way, it says, "if this begins with external, keep the State the entire string, not just the word 'external'".
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
griffin
Znuny newbie
Posts: 20
Joined: 29 Apr 2015, 19:51
Znuny Version: 3.3.8
Real Name: Marcos

Re: [SOLVED] How to prevent a closed ticket to reopen?

Post by griffin »

Sorry for reviving old thread.

Im in OTRS 4 and none of these solutions keep my ticket from not reopening.

My ticket state= 'solucionado'
State type = 'solved'

tried

Code: Select all

if (
        $Ticket{StateType} =~ /^solve/
        )
    {
        #$State = $ConfigObject->Get('PostmasterFollowUpStateClosed');
		$State = $Ticket{State};
    }
and

Code: Select all

 if ( $Ticket{State} =~ /^external/ )  { $State = $Ticket{State}; }
and still it changed it.

also with PostmasterFollowUpStateClosed on or off.
OTRS: 4.0.8
Database: MySQL
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [SOLVED] How to prevent a closed ticket to reopen?

Post by crythias »

Because you chose to create a new state type that is not of type closed, this will be a problem.
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
griffin
Znuny newbie
Posts: 20
Joined: 29 Apr 2015, 19:51
Znuny Version: 3.3.8
Real Name: Marcos

Re: [SOLVED] How to prevent a closed ticket to reopen?

Post by griffin »

But the code you proposed does not take into account if its closed or not. it just keeps the state.

how can i let users comment closed tickets but not reopen them then? that would be the other solution.
OTRS: 4.0.8
Database: MySQL
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [SOLVED] How to prevent a closed ticket to reopen?

Post by crythias »

griffin wrote:But the code you proposed does not take into account if its closed or not. it just keeps the state.

how can i let users comment closed tickets but not reopen them then? that would be the other solution.
If it's closed and you want to keep it closed, use the followup attached to queue:
possible: and it opens the ticket.
reject: and it keeps it closed, and accepts the followup message but auto reply reject applies.
new: and it creates a new ticket.

Note that this thread is over 4 years old and is based upon:
HervE wrote:we want a closed ticket to be reopened if a customer replies[if it's our ticket] - i.e. the default treatment in OTRS.
we don't want a closed ticket to be reopened [if we've handed it off and we've closed it].
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
Post Reply