Here’s a poser for you.
I have a Scrip/Template combo that creates a ticket.
Now I want to duplicate that code in custom code.
I could try to duplicate that as $Ticket->Create() code,
but as soon as I start looking for the Parent and DependsOn
params (which don’t seem to be there!) I hit a wall.
Then I think why can’t I just load the already existing
Scrip and Template, and execute them? This would prevent
any discrepancy creeping in between the coded action and
But… how do I do this? I see the $Scrip->Apply() method,
but there’s no $Scrip->Load() method.
So how do I bring up the scrip I want, so that I can then
Suggestions or other ways of looking at this most appreciated.
Normally a transaction triggers a scrip, so I would look at
the Transaction code (probably the Create method) and see
how it loads and runs a scrip. This may not work though
because a scrip may expect to run in the context of a
The perldoc for Transaction_Overlay says:
Create a new transaction.
This routine should _never_ be called anything other Than
RT::Ticket. It should not be called from client code. Ever. Not
ever. If you do this, we will hunt you down. and break your
kneecaps. Then the unpleasant stuff will start.
…I’m not sure what this means, but I don’t think I want to go there.
It would be better to write the code to do what you want
and then have the scrip call that code. That avoids the
Maybe I should be a bit clearer.
My scrip creates a ticket using a template. That’s all.
The reason the idea of executing the scrip from code occurred
to me is that I can’t figure out how to pass the template parameters
to my $Ticket-Create() call, like Parents, and DependsOn, things
Do you see what I mean? The entire “action” of the scrip is already
contained in the scrip itself and the template associated with it.
It makes sense for it to stay there.
I just want to execute it from code.