How to use Update-Ticket template?

I’m trying to use an Update-Ticket template to change the queue
that a ticket is in. Is this possible?

Here is the template (ChangeQueue):

===Update-Ticket: TOP
Queue: Queue2
Content: moved into second queue
ENDOFCONTENT

The scrip is:
condition = OnResolve
Action = Create Tickets
Template = ChangeQueue
Stage = TransactionCreate

In the logfile, I see the following:
**** Update ticket: update-TOP
Line: Queue: Queue2
Line: Content: moved into second queue
Line: ENDOFCONTENT
About to commit scrips for transaction #4254
In CreateByTemplate
Update Workflow: processing update-TOP
Workflow: evaluating Queue: Queue2 Content: moved into second queue ENDOFCONTENT
Workflow: yielding Queue: Queue2 Content: moved into second queue ENDOFCONTENT
[1] Couldn’t update ticket update-TOP: Couldn’t find row (/usr/local/rt3.6.1/lib/RT/Action/CreateTickets.pm:679)
[2] Use of uninitialized value in concatenation (.) or string at /usr/local/rt3.6.1/lib/RT/Action/CreateTickets.pm line 1414. (/usr/local/rt3.6.1/lib/RT/Action/CreateTickets.pm:1414)
Handling links for
[3] Use of uninitialized value in concatenation (.) or string at /usr/local/rt3.6.1/lib/RT/Action/CreateTickets.pm line 1461. (/usr/local/rt3.6.1/lib/RT/Action/CreateTickets.pm:1461)

[1] refers to:
unless ( $loaded ) {
$RT::Logger->error("Couldn’t update ticket $template_id: " . $msg);
push @results, $self->loc( “Couldn’t load ticket ‘[_1]’”, $id );
next;
}

Based on other tests, having the ticket id (e.g., 123) in the template like this:
===Update-Ticket: 123

works, but how do I get the ticket id placed there dynamically?

I tried this:
===Update-Ticket: { $Tickets{‘TOP’}->Id }

but it seemed to just take that literally and did not evaluate
the expression.

Any help greatly appreciated.

Matthew