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

Plugin merging

Original thread:

Since this mod was released we've been using it as a core modification but in order to make the changes maybe stay in future releases i decided to try and port it to a plugin and here's a start of it.

You can merge and split tickets, both single and mass.
Bring the recipients from the child tickets.

I've not ported the thread merging or redirection yet.

Note: This plugin adds a table %prefix%_ticket_relation and it also alters the conditions thread event table, this in order to add the events to tickets.
When uninstalling the changes will be removed, so any relations between tickets will be removed but tickets will remain in their current state.
Any events that were merged/split will lose their text even after reinstalling the plugin.


  • I look forward to testing this!

  • Sounds great, I'll check it out also.
  • Hi,
    I have installed the plugin on my system, however when I try to join two tickets between them nothing happens.
  • @mnavarro, do you get any errors in your javascript console? you need to enable xmlhttprequests here.
    Can you see if anything has happend in the database?
  • this is the error on console. 
  • Sorry I just saw that the folder inside include \ plugins did not have the same name as in js search.

    changed the name of the folder, now I get the following error:
    jquery-1.11.2.min.js?9ae093d:4 POST https://scf/include/plugins/Merging/ajax.php 500 (Internal Server Error)
    send @ jquery-1.11.2.min.js?9ae093d:4
    ajax @ jquery-1.11.2.min.js?9ae093d:4
    (anonymous) @ VM6290:12
    dispatch @ jquery-1.11.2.min.js?9ae093d:3
    r.handle @ jquery-1.11.2.min.js?9ae093d:3

  • Yes the first error is indeed incorrect path, but that should be accounted for so, I shall have a look at that aswell.
    I'll see if i can find what it's later on, could you send what webserver you're using, php version, database and browser?
  • the server is an ubuntu desktop. the attach file is the web server info and the browser is chrome.

  • Hmm it seems like the problem resides in the way the plugins config is fetched when using php 7.x
  • @mnavarro can you try updating with the latest commit and see if that works for you?
  • I initially had the same trouble with the naming of the directory containing the plugin, however, after that I'm able to click on stuff and entries are appearing ost_ticket_relation. I haven't really checked much further than that.
  • Yes that was my main concern and i'll take the installation directory into consideration soon.
  • @Micke1101 thanks, now it works correctly.
    the only "error" I see at the moment is that the folder has to be called "Merging".

    I'll make more checks throughout the week, in case I find any bug I'll let you know.

    Once again, thank you very much for your work.
  • edited October 2017
    @Micke1101 I have started testing this as well, and like mnavarro when i try to merge tickets, nothing happens. Like nothing at all. Don't see any errors in any logs, and i have the latest commit downloaded.

    Server Information
    osTicket Version v1.10.1 (9ae093d) —  Up to date
    Web Server Software Microsoft-IIS/7.5
    MySQL Version 5.7.17
    PHP Version 5.6.24


    Scratch my no errors comment, this is what I am getting when I click the merge button:

    jquery-1.11.2.min.js?9ae093d:4 POST https://[sitename]/support/include/{MERGING_INSTALL_PATH}/ajax.php 404 (Not Found)
  • Yea I just tested that commit and found that i had forgot to rename a variable, it should work now @blueyeguy @mnavarro
  • @micke1101 The path works fine, no rename neded.
    Another issue, in the default configuration I have established that 
    the child ticket changes state to closed, however it remains open.

    I understand that it is not implemented yet.
  • Hmm ok after testing a bit it seems that the problem is that the configuration changes are not being read the way the config call is made, instead it uses the defaults, so if you want to do a quick fix then just edit the config file default values to the value you want, i'll see if i can solve it tomorrow.
  • @Micke1101 I've had that issue before with changes to a plugin's config in code, usually the fix is just deleting the plugin and reinstalling. (Deleting from the admin screen just deletes the config in the database).
  • Hi Mike,
    I'm testing OSTicket for implement it in the company I work for. I need to join tickets, so I tred to install the mod as described in, it failed and I got a lot of error messages.
    I red it's better to install this as a plug-in so it'll be easier to upgrade, so here I am.
    Please, could you give me detailed instruccions for install this plug-in? Please, note I am absolutly newby in PHP, so an Step-by-Step will be apreciated.

  • Hi Again.
    I've found the way to install the plug-in.
    Thank you.
  • Hi Micke1101,
    I tried this plugin, merging works, but the suggestion is made that it would be possible to split a ticket, I don't see how t do this,
  • @eddieb if you look on the master ticket it should have a relations tab, open that and then you should have a list of all the child tickets and next to each child should be a trash can, the trash can should split the child from the master ticket
  • Ah, I understand. I was looking for the possibility to split an initial ticket into 2 due to possible 2 questions to totaly different departments (for example : helpdesk and member-administration)
    tnx anyway
  • @eddieb Hmm i believe the core modification version of this plugin:
    Might have something for you then, unfortunately it does modify core, but plugins are unfortunately very limited when it comes to adding controls etc.

    Anyway what the core modification version has is that it has a duplicate option that lets you make an exact replica of the ticket (I didn't see a need for it for myself but the original creator had it), so I'm thinking that you can then create a duplicate and assign the first one to helpdesk and the duplicate to member-administration.
  • tnx for diving into it. As I am not "that" good in programming, I need to wait for some development that fits my needs ...

  • Micke1101, I'm receiving an error with the plugin

    [19-Mar-2018 19:24:15 UTC] PHP Warning:  Missing argument 1 for Plugin::__construct(), called in C:\inetpub\wwwroot\esd\include\plugins\OSTicket-plugin-Merging-master\class.MergingPlugin.php on line 223 and defined in C:\inetpub\wwwroot\esd\include\class.plugin.php on line 373

    Any idea what this might be, I have searched and searched and can't seem to find an answer. 

  • @the_binder that is not an error, but rather a warning.
    That section is used to get the configuration of the plugin as the function is called in a unusual way.
  • Thanks @Micke1101

    I'm also tracking down an issue when child tickets are blank white pages but I believe that is due to length of the ticket subject and I'm still investigating. 

  • That does however sound like php error, is that when you get that warning?
  • edited March 23
    @Micke1101 Thanks for your work on the plugin!
    I have installed the latest GIT commit and facing the issue that the child tickets not gona be closed.

    The merge seems to work fine, since the ticket_relation table is filled with the right ticket numbers.
    In the plugin config I have set, that the child tickets should get the closed state.
    This is not working, after the merge, the ticket remains untouched.

    When I check the class.MergingPlugin.php file at line 269 the insert takes place, but the sql query to update the ticket state is missing.

    So i added the following code to change child tickets to close state:

    // close the child ticket
    // close ticket = Status_id = 2
    $sqlTicketState ='UPDATE osticket_ticket SET status_id = 2, closed = NOW() WHERE ticket_id = '.$temp->getId();

Sign In or Register to comment.