[rt-users] Dynamic Template selection from a UserDefined scrip
Ruslan U. Zakirov
cubic at acronis.ru
Mon Jul 12 12:44:19 EDT 2004
Andre Sachs wrote:
> 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.
RT doesn't support stacked scrips, but notifications are handled by
ScripAction too.
http://wiki.bestpractical.com/index.cgi?ChooseTemplateByUserLang
>
> 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
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT wiki at http://wiki.bestpractical.com
More information about the rt-users
mailing list