[rt-users] CFs in Templates?

Kenneth Crocker KFCrocker at lbl.gov
Tue Dec 18 15:32:55 EST 2007


JB,

	"AND Then, at some point, I introduced 'CFName'... which is not the 
same as 'CFname'... which kept anything from working for quite a while."
	That's funny. I can't tell you how many times I've done that.
	I have a question on your CF values. This may seem dumb and I don't 
want to insult you, but does EACH of the CF's you are trying to set have 
(as one of the "defined" values) the value you are trying to set it to? 
For example, if you are trying to set CF-1 to "Wierd" and "Wierd" is NOT 
one of the values defined, I don't think it will work. I thought it just 
might be something you were overlooking and another set of eyes would help.
	The only other thing I can think of is that when I set several CF's to 
a value in a scrip, I make sure the STAGE is "TransactionBatch" and they 
all work fine. Hope this helps.


Kenn
LBNL

On 12/18/2007 9:56 AM, JB Segal wrote:
> Status update: Due to some fine, fine IRC-based help, I've got this
> working - mostly.
> 
> The problems were:
> $OUTPUT was being declared and dumped inside the loop, so nothing was
> ever being set,
> AND Then, at some point, I introduced 'CFName'... which is not the same
> as 'CFname'... which kept anything from working for quite a while.
> 
> So what I have now, that mostly works is:
> RT-Attach-Message: yes
> { my @CFlist = ('Product', 'Application Area', 'Request Type', 'OK to Outsource', 'Secondary Status');
>   my $OUTPUT;
>   foreach my $CFname (@CFlist) { 
>   my $CFvalues = $Ticket->CustomFieldValues($CFname);
>   while ( my $value = $CFvalues->Next ) { 
>     $CFname =~ s/ /-/g;
>     $OUTPUT .= "X-${CFname}: ";
>     $OUTPUT .= (($value->Content ne '') ? $value->Content : 'unset');
>     $OUTPUT .= "\n";
>   }  }   $OUTPUT; }
> 
> What's not working about this?
> 
> A) Originally I had 'RT-Attach-Message: yes' at the bottom of this, with
> no blank line between the "$OUTPUT; }" and the "RT-Attach-Message: yes"
> and yet a blank line was being generated and the attachments weren't,
> well, attaching.
> 
> B) I'm only getthing the 1st 2 CFs - 'Product', 'Application Area' -
> populated. Of the 5, they're the only 'Select Multiple' ones, the others
> are all 'Select One'.
> 
> In discussions on IRC, it was suggested that I look at RT/Record.pm and
> how FirstCustomFieldValue and CustomFieldValues are generated. As near
> as _I_ can tell, FCFV simply calls CFV and returns the 1st value.
> This leaves me perplexed as to why I can't call CFV on a Select One and
> have it do the Right Thing(tm).
> 
> If anyone has any further suggestions, I'd love to hear them.
> 
> (The next expansion of this whole thing is the automatic inclusion of
> headers for all CFs appropriate for every given queue. Suggestions as to
> what I want to do there are totally welcome.)
> 
> JB
> 
>> Quoth JB Segal (jb at smarterliving.com):
>>> { my @CFlist = ('Product', 'Application Area');
>>>   foreach my $CFname (@CFlist) {
>>>   my $CFvalues = $Ticket->CustomFieldValues($CFname);
>>>   my $OUTPUT;
>>>   while ( my $value = $CFvalues->Next ) {
>>>     $CFName =~ s/ /-/g;
>>>     $OUTPUT .= "X-$CFname: ";
>>>     $OUTPUT .= ($value->Content eq '') ? $value->Content : 'unset';
>>>     $OUTPUT .= "\n";
>>>   }
>>>   $OUTPUT;
>>>  }
>>> }
>>>
>>> but this doesn't work.
> --
> 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
> 




More information about the rt-users mailing list