Re: Merging Tickets

Emmanuel Lacour <[email protected]>
Newsgroups gmane.comp.bug-tracking.request-tracker.user
Message-ID <[email protected]>
Le 26/09/2016 à 07:44, Thanos Constantopoulos a écrit :
> Odyssey
>
> Dear All
>
>  
>
> Is there a way to prevent ticket merging when the tickets are not in
> the same queue?
>
>  
>


you have to override the method RT::Ticket->MergeInto for this.

Here is an (untested) sample code to put in rt/local/lib/RT/Ticket_Local.pm:


package RT::Ticket;

use strict;
no warnings qw(redefine);

my $old_mergeinto = \&MergeInto;

*MergeInto = sub {
    my $self = shift;
    my $ticket_id = shift;

    my $MergeInto = RT::Ticket->new($self->CurrentUser);
    $MergeInto->Load($ticket_id);

    if ( $MergeInto->Id ) {
            if ( $self->Queue != $MergeInto->Queue ) {
                 return ( 0, $self->loc("Can't merge tickets from
different queues ([_1], [_2])", $self->QueueObj->Name,
$MergeInto->QueueObj->Name) );
            }
    }
   
    return $old_mergeinto->($self, @_);

};

1;



if you only take care of the web interface, youb should be able to block
the merge processing using the callback located in
share/html/Ticket/ModifyLinks.html, by looking at posted args, loading
target ticket and checking queues against $TicketObj->Queue. Then if
queues does not match, push a message in @$Results and delete the merge
from $ARGSRef.

---------
RT 4.4 and RTIR training sessions, and a new workshop day! https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.