Merge multiple tickets

Moderator: crythias

Locked
jester
Znuny newbie
Posts: 24
Joined: 12 Oct 2015, 05:12
Znuny Version: OTRS 5
Real Name: Sergii

Merge multiple tickets

Post by jester »

Dear colleagues,

For some reason (don't ask me why :) ) we need to merge all tickets arrived during certain period of time from single customer into one ticket.

What is the best way to achieve this?
OTRS 5.0.9 on CentOS 7.1 with MariaDB
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Merge multiple tickets

Post by crythias »

Magnifying glass, search, select all, click Bulk, Merge to Oldest/specific ticket number.
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
jester
Znuny newbie
Posts: 24
Joined: 12 Oct 2015, 05:12
Znuny Version: OTRS 5
Real Name: Sergii

Re: Merge multiple tickets

Post by jester »

Hello crythias,

Thanks for your idea. As far as I can understand, this will merge all tickets from search result into one ticket. This is not exactly what I want.

I want to merge tickets from one customer into one. For example, all tickets from CustomerA during this period should be merged into single ticket, all tickets from CustomerB should be merged into TicketB, etc.

I can't set specific customer in search because we have a lot of them during target period.

It looks like we can't do it without API/database connection...
OTRS 5.0.9 on CentOS 7.1 with MariaDB
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Merge multiple tickets

Post by EXG133 »

That sounds horrible to be honest. First reaction: fix it on the customers side, not in OTRS.

However... if this spam is some sort of incident / alert / ... system that uses their own numbering you could use ExternalTicketNumberRecognition?
jester
Znuny newbie
Posts: 24
Joined: 12 Oct 2015, 05:12
Znuny Version: OTRS 5
Real Name: Sergii

Re: Merge multiple tickets

Post by jester »

EXG133,

I totally agree with you, but it is accumulated already and I have to deal with it. It will be definitely fixed later.

No, incoming tickets are human-written so Subject/Body are different in each case
OTRS 5.0.9 on CentOS 7.1 with MariaDB
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Merge multiple tickets

Post by EXG133 »

Ah the tickets exist already, I missed that.

In that case I don't think you can automate it using the default OTRS tools. You would have write a module that searches the relevant tickets and calls $TicketObject->TicketMerge

If I'm wrong I'd be very intrested in hearing what I missed :)
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Merge multiple tickets

Post by crythias »

I'm in agreement with EXG133.
The original request seemed simple enough but now you've changed the parameters to be merge all tickets to one for multiple individual customers.
jester wrote:I want to merge tickets from one customer into one. For example, all tickets from CustomerA during this period should be merged into single ticket, all tickets from CustomerB should be merged into TicketB, etc.
Which, so far, yes...
jester wrote:I can't set specific customer in search because we have a lot of them during target period.
New information...

So, basically
$result= search tickets in date range
@hugeCustomerList = distinct customer_id from $results;
For $customer in @hugeCustomerList {
@result = search for LargeNumberOfTickets from $customer in date range;
merge tickets[@result] to oldest(?);
}
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
jester
Znuny newbie
Posts: 24
Joined: 12 Oct 2015, 05:12
Znuny Version: OTRS 5
Real Name: Sergii

Re: Merge multiple tickets

Post by jester »

EXG133, crythias,

Yes, algorithm is absolutely correct.

I solved this problem by interacting directly with the database. I understand that it is worst way to change tickets directly in database, but I have no developers with OTRS API knowledge yet.
OTRS 5.0.9 on CentOS 7.1 with MariaDB
Locked