my $checkTicketQueue = $self->TicketObj->QueueObj->Name should work
If the ticket object is not the ticket you are interested in checking you need to load a new ticket object using which ever ID you have and then check the queue.
my $new_ticket = RT::Ticket->new( $session{'CurrentUser'} );
$new_ticket->Load( 1234 );
I am trying to get the queue name from a ticket ID
for example:
Current ticket id : 100 ($self->TicketObj->id)
Current ticket id queue: queue1 ($self->TicketObj->id->Queue->Name)
previous ticket id : 99 ($self->TicketObj->id-1)
Current ticket id queue: queue2 ($self->TicketObj->id-1->Queue->Name)
previous ticket id : 98 ($self->TicketObj->id-2)
Current ticket id queue: queue1 ($self->TicketObj->id-2->Queue->Name)
Give it a try and test! But a quick look I’d say no. $prev_ticket->Queue->Name; In my example the method is “QueueObj” not “Queue”. I believe Queue just returns a queue ID.
The $ticket_tracker would be descending within a loop
You may want to also add some debug code to each line to see in the logs whats going on