[rt-users] CFs in Templates?

JB Segal jb at smarterliving.com
Thu Dec 13 12:07:04 EST 2007


Quoth Gene LeDuc (gleduc at mail.sdsu.edu):
> I'm not sure what your end goal is, but I use the following subroutine in my templates when I need to 

My goal is to give people things to sort on in their mailer, such that
they can better manage the flood of incoming mail.

> get CFs.  It's mostly from various wiki examples.
> 
>   ### Returns custom field value
>   ### get_custom($field_name)
>   sub get_custom {
>     my $target_name = $_[0];
>     my $val = $Ticket->FirstCustomFieldValue($target_name);
>     return $val if defined $val;
>     return undef;
>   }
> 
> If your CF is named "blahblah" then you get the value with
>   $cfval = get_custom('blahblah');
> 
> Returns undef if it's not allowed to get the CF or it doesn't exist.
> 
> Regards,
> Gene

So how does this mesh with the below-quoted Template Field
'CustomField-<id#>'? It _looks_ like that's just supposed to Do The
Right Thing, but it obviously doesn't.

Oh! Or is this a poor naming thing, and really the template field
should be named something more like CustomHeader or some such?

JB

> At 07:29 AM 12/13/2007, JB Segal wrote:
> >According to http://wiki.bestpractical.com/view/Template_Fields
> >"Key  Name                 Meaning
> >      CustomField-<id#> => custom field value"
> >
> >But creating a per-queue 'Correspondence' template which looks exactly
> >like the Global 'Correspondence' template with
> >CustomField-10: yes
> >CustomField-18: yes
> >prepended (or just
> >CustomField-10
> >CustomField-18
> >)
> >
> >just ends me up with a mail message with the lines
> >Customfield-10: yes
> >Customfield-18: yes
> >
> >in the headers.
> >
> >Neither
> >http://wiki.bestpractical.com/view/Template
> >nor Template_Fields discuss a more detailed mechanism for pulling this
> >data out of a ticket and in to mail.
> >
> >Any help will be much appreciated.
> >JB
> >--
> >JB Segal                 617-886-5575            www.smartertravel.com
> >Systems/Network Admin.   465 Medford St. Ste 400 www.bookingbuddy.com
> >Smarter Travel Media LLC Boston, MA 02129        www.tripmania.com
> >_______________________________________________
> >http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >
> >SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
> >
> >If you sign up for a new RT support contract before December 31, we'll take
> >up to 20 percent off the price. This sale won't last long, so get in touch today.
> >    Email us at sales at bestpractical.com or call us at +1 617 812 0745.
> >
> >
> >Community help: http://wiki.bestpractical.com
> >Commercial support: sales at bestpractical.com
> >
> >
> >Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> >Buy a copy at http://rtbook.bestpractical.com
> 
> 
> -- 
> Gene LeDuc, GSEC
> Security Analyst
> San Diego State University 
--
JB Segal                 617-886-5575            www.smartertravel.com
Systems/Network Admin.   465 Medford St. Ste 400 www.bookingbuddy.com
Smarter Travel Media LLC Boston, MA 02129        www.tripmania.com



More information about the rt-users mailing list