Permalink
Browse files

New helper method, ConvertQueue

Looks up the new QueueID from the name, defaulting to General if there isn't one that matches.
  • Loading branch information...
1 parent 227bd30 commit 94384679ff488a2557503b7a90854f26d490b5e7 @afresh1 committed Jul 11, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 rt-ticket-importer
View
@@ -79,6 +79,7 @@ $SIG{__DIE__} = "";
eval { RT::DropSetGIDPermissions() };
my %USERS;
+my %QUEUES;
my %TICKETS;
my %TRANSACTIONS;
my %LINKS;
@@ -94,6 +95,14 @@ sub ConvertUser {
return $USERS{$user};
}
+sub ConvertQueue {
+ my ($queue) = @_;
+ return $QUEUES{$queue} if $QUEUES{$queue};
+ my $queueObj = new RT::Queue($RT::SystemUser);
+ $queueObj->Load($queue);
+ return $QUEUES{$queue} = $queueObj->Id || ConvertQueue('General');
+}
+
sub ConvertTicket {
my $id = shift;

0 comments on commit 9438467

Please sign in to comment.