Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

[resolved] Mass-Merging of Tickets

Hello all,

We are looking to condense our open/closed tickets for better tracking of individual submitters. We recently upgraded to version 1.9.3 and want to use the AD integration. Currently we have users who have used up to 5 different emails/name combo's to submit tickets. What is the fastest way to combine all of their old tickets into one user? Currently we have almost 700 "users" with 9000 tickets, so modifying ticket by ticket isn't preferred.

Example of this:

User "Fake Name" submits several tickets as follows:

FName@email.com
Fake.Name@email.com
FakeName@email.com
FakeName@personalemail.com
FakeName@otherpersonalemail.com

How could all those be combined into just the Fake.Name@email.com user?


Thank you in advance.

Comments

  • edited October 2014
    There isn't a fast easy way to do this in the ui (save going into each ticket and changing the owner).
    I think that the easiest way would be to look at the ost_user table.
    Identify the dupes by name (note the id's)
    for example:
    8,0,8,0,Faker,date,date
    112,0,112,0,Fake Name,date,date
    157,0,157,0,Faux Name,date,date

    Presuming that Faker is the one that you want to keep you then look at ost_ticket you could do something like:

    UPDATE ost_ticket SET user_id='8',user_email_id='8' WHERE user_id='112';
    and
    UPDATE ost_ticket SET user_id='157',user_email_id='157' WHERE user_id='157';

    now all the tickets that used to be owned by 112 and 157 are now owned by user 8.

    NOTE: make sure you back up your DB before you start issuing SQL level commands.
  • ...and UPDATE ost_ticket SET user_id='157',user_email_id='157' WHERE user_id='157';
    Are you sure about that one?  Looks like it ought to be:
    UPDATE ost_ticket SET user_id='8',user_email_id='8' WHERE user_id='157';

    Jack
  • Thank you for the info. I will pass it on to our database admin and see if he can clean it up with those commands.
  • Yes it should be:

    UPDATE ost_ticket SET user_id='8',user_email_id='8' WHERE user_id='157';
  • Thank you, that code is working, now to sift through all the accounts.
  • Excellent.  I'll mark this thread as resolved and close it.

    If you have another question, comment, concern, etc please feel free to start a new thread.
This discussion has been closed.