Queue Cloning in RT 4.4

Hi

Ive been away from RT for 6/7 years and I’m trying to remember what does what. What’s the current best way to clone an existing queue? Is it still to use the RT-clonequeue perl code (https://rt-wiki.bestpractical.com/wiki/Rt-clonequeue), or is there some extension or callback hackery, that adds the ability to the interface.
Ive had a look through the forum and most of the answers/topics on this are about 5 years old, so I’m just checking incase anything has changed since

regards
Garry

I’ve been playing with this code along with @G.Booth and it seems to work. I’ve made a few modifications though so that we can pass the queue cloning information in via command line parameters, which means that we can then do funky scripting things with this (such as fronting it with a web page to allow our service desk staff to clone queues without disturbing us. :wink: ). Here’s a context diff of the changes if anyone else is interested:

*** /tmp/rtCloneQueue	2017-12-20 14:26:23.468059223 +0000
--- /opt/rt4/local/lib/rtCloneQueue	2017-12-20 11:37:13.391905432 +0000
***************
*** 43,58 ****
  
  use strict;
  #specify your rt lib path (default /usr/local/rt4/lib)
! use lib '/usr/local/rt4/lib';
  use warnings;
  #uncomment if you install this in [...]/rt4/bin
  #use lib qw(../lib);
  use RT;
  use RT::Queues;
  use RT::Tickets;
  
  my $newqueue;
  my $clonequeue;
  
  print "\nRT Queue and setup cloning/merging\n";
  
--- 43,71 ----
  
  use strict;
  #specify your rt lib path (default /usr/local/rt4/lib)
! use lib '/opt/rt4/lib';
  use warnings;
  #uncomment if you install this in [...]/rt4/bin
  #use lib qw(../lib);
  use RT;
  use RT::Queues;
  use RT::Tickets;
+ use Getopt::Long;
  
  my $newqueue;
  my $clonequeue;
+ my $emailcorrespond;
+ my $emailcomment;
+ my $qdescr;
+ my $subjecttag;
+ 
+ GetOptions ("clonequeue=s" => \$clonequeue,
+ 	    "newqueue=s" => \$newqueue,
+ 	    "emailcorrespond=s" => \$emailcorrespond,
+ 	    "emailcomment=s" => \$emailcomment,
+ 	    "qdescr=s" => \$qdescr,
+ 	    "subjecttag=s" => \$subjecttag,
+     );
  
  print "\nRT Queue and setup cloning/merging\n";
  
***************
*** 63,74 ****
  print "-to an existing queue (merge mode)-\n";
  print "-or to a new queue (clone mode)   -\n";
  print "-----------------------------------\n";
! print "Name of cloned Queue (source queue):";
! $clonequeue = <>;
! chomp($clonequeue);
! print "Name of new Queue (destination queue):";
! $newqueue = <>;
! chomp($newqueue);
  
  RT::LoadConfig();
  RT::Init();
--- 76,91 ----
  print "-to an existing queue (merge mode)-\n";
  print "-or to a new queue (clone mode)   -\n";
  print "-----------------------------------\n";
! if(!defined $clonequeue) {
!     print "Name of cloned Queue (source queue):";
!     $clonequeue = <>;
!     chomp($clonequeue);
! }
! if(!defined $newqueue) {
!     print "Name of new Queue (destination queue):";
!     $newqueue = <>;
!     chomp($newqueue);
! }
  
  RT::LoadConfig();
  RT::Init();
***************
*** 97,114 ****
  
  if ( ! defined($res) || $res eq "" ) {
     print "   * Cloning mode: Creating new queue '$newqueue'\n";
!    print "   ** Please enter the correspond email address for queue '$newqueue':";
!    my $emailcorrespond = <>;
!    chomp($emailcorrespond);
!    print "   ** Please enter the comment email address for queue '$newqueue':";
!    my $emailcomment = <>;
!    chomp($emailcomment);
!    print "   ** Please enter the description for queue '$newqueue':";
!    my $qdescr = <>;
!    chomp($qdescr);
!    print "   ** Please enter the subjectTag for queue '$newqueue':";
!    my $subjecttag = <>;
!    chomp($subjecttag);
  
     my ($queueid) = $NewQueueObj->Create(
         Name              => $newqueue,
--- 114,139 ----
  
  if ( ! defined($res) || $res eq "" ) {
     print "   * Cloning mode: Creating new queue '$newqueue'\n";
!    if(!defined $emailcorrespond) {
!        print "   ** Please enter the correspond email address for queue '$newqueue':";
!        $emailcorrespond = <>;
!        chomp($emailcorrespond);
!    }
!    if(!defined $emailcomment) {
!        print "   ** Please enter the comment email address for queue '$newqueue':";
!        $emailcomment = <>;
!        chomp($emailcomment);
!    }
!    if(!defined $qdescr) {
!        print "   ** Please enter the description for queue '$newqueue':";
!        $qdescr = <>;
!        chomp($qdescr);
!    }
!    if(!defined $subjecttag) {
!        print "   ** Please enter the subjectTag for queue '$newqueue':";
!        $subjecttag = <>;
!        chomp($subjecttag);
!    }
  
     my ($queueid) = $NewQueueObj->Create(
         Name              => $newqueue,