Greetings, RT enthusiasts!
I am trying to merge two pre-existing tickets by a stand-alone Perl script.
Here’s the full script:
# make STDERR unbuffered
|| die “can’t binmode STDOUT to :unix: $!”;
print STDERR “Initializing RT…”;
# Become RT System User
$CurrentUser = RT::CurrentUser->new;
die “Could not become RT System User” unless $CurrentUser;
print STDERR “Done.\n”;
my $TicketA_id = 33842; #Ticket A
my $TicketB_id = 34497; #Ticket B
my $TicketA_obj = new RT::Ticket(RT->SystemUser);
my ($val, $msg) = $TicketA_obj->AddLink(
Type => ‘MergedInto’,
Target => $TicketB_id,
print “RT::AddLink returned val ‘$val’ and msg ‘$msg’\n”;
And here’s the output:
RT::AddLink returned val ‘6’ and msg ‘Ticket 33842 merged into
In the web UI, I see the following transactions are created:
In ticket 33842:
The RT System itself - Merged into ticket #34497
In ticket 34497:
The RT System itself - Merged into ticket #33842
Needless to say, the tickets are not merged properly - they continue
to be displayed separately.
Advice, pointers how to do this properly?
Thanks in advance!