[rt-users] Initiating tickets and entering tickets via forward

Jerrad Pierce jpierce at cambridgeenergyalliance.org
Tue Aug 25 15:05:11 EDT 2009


On Tue, Aug 25, 2009 at 14:47, Jerrad
Pierce<jpierce at cambridgeenergyalliance.org> wrote:
>> Including the template (as in the ForkTemplate contribution on the
>> Wiki) didn't work, since I had variables to evaluate in each template,
>> and doing it as ForkTemplate suggests ends up just pasting the perl
>> code in the sub-templates, rather than evaluating them.  Maybe wrap
>> the template I loaded in an eval statement or something?  I am a perl
>> newbie, so I'm at a bit of a loss.
>
> Calling _ParseContent on your $obj instead of fetching the Content should work?

And if that doesn't work (if it does, the wiki should be updated),
you might heed the last sentence of ForkTemplate:

  The .. effect could also be achieved through the clever use of
  $self->SetTemplate in CustomCondition.

i.e; do your switching to pick a template in a scrip.
You don't to save on repeated content amongst templates that way though.
Untested example:

  my $trans = $self->TransactionObj;
  return 0 unless $trans->Type eq "Create";
  $self->SetTemplate( $condition ? 'foo' : 'bar' );

-- 
Cambridge Energy Alliance: Save money. Save the planet.



More information about the rt-users mailing list