[rt-users] Dynamic choice of templates based on the value of a CF

Landon Stewart lstewart at iweb.com
Fri Sep 6 14:04:30 EDT 2013


We classify tickets based on content and store that classification as a
string in a CF called CF.{Classification}.  This is an RTIR instance but
that is not really relevant other to say that when we open an Investigation
on an Incident we want the template that is used for the Investigation to
be dynamic based on the value of the CF.{Classification} field.

Currently what I'm doing is I have a Scrip for each Classification with a
condition for that classification as well as the "On Create" condition.
 When each Scrip fires it checks to see if the Investigation is that
Classification.  If it is the template associated with the Scrip is used.
 This is messy because it requires a Scrip for each Classification.

Instead one Scrip for "On Create" that chooses the template dynamically.

What I think I can do is simply have one very short Template that is
basically 100% perl and includes some text from a text file stored on the
file system but outside RTIR.  Which file gets included in the Template is
dependent upon the CF.{Classification}.

ie:
{ require
"/path/to/templates/".$Ticket->FirstCustomFieldValue('Classification').".template";
}

Would this even work?  Is there a better way to choose a Perl template in
the Scrip so that templates can be kept within RT?

-- 
Landon Stewart :: lstewart at iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130906/05f1f5d0/attachment.html>


More information about the rt-users mailing list