[rt-users] Dynamic Template selection from a UserDefined scrip

Andre Sachs asachs at clue.bz
Sun Jul 11 15:48:30 EDT 2004


Hi,

I am trying to get a scrip to dynamically select a template,
based on the value of a custom field. I have created a custom
field called test (populated with the value test) and a template with
the same name.

It seems to execute properly but the template is not used to mail
a response (even though use of an RT::Logger confirms that it is
being loaded).

Any ideas would be greatly appreciated.

Regards
  Andre Sachs


This is what my scrip looks like:

Condition: UserDefined
Custom Condition:
	return 1; # test installation

Action: UserDefined
Custom action preparation code:

	my $template_name = $self->TicketObj->FirstCustomFieldValue("test");
	my $template = new RT::Template($RT::SystemUser);
	$template->LoadGlobalTemplate($template_name);
	$self->{'TemplateObj'} = $template;

	return 1;

Custom action cleanup code:
	return 1;

Stage: TransactionCreate
Template: Global: Blank

--
Andre Sachs
Software Developer
Clue Consulting




More information about the rt-users mailing list