[rt-users] Using Keywords in Scrips

Jeremy Doran fox-rt_users at vulpes.net
Thu Aug 15 14:57:58 EDT 2002


On Tue, 2002-08-13 at 02:20, Bruce Campbell wrote:
> On 12 Aug 2002, Jeremy Doran wrote:
> 
> > I'd like to be able to make use of the keywords that I have set in a
> > queue and use whatever is set in a scrip.
> >
> > More specifically, I'd like to be able to add the first keyword that
> > appears for the ticket to the subject line to get something like:
> 
> 'first' is unreliable when multiple keywords can be applied to a ticket.
> 
> > [rtname #22] [support] Rest of the subject line here.
> 
> I have the following snippet in my correspondence template, to end up with
> headers such as:
> 
> 	X-RT-Keyword: Magic keyword
> 
> You could change this to add a particular keyword to the subject line.
> 
> Something like this should probably be a KeywordsAsString method in
> RT::Ticket.

I guess that if I know the particular Id I want from KeywordSelects, I
could use it in a per-queue template. 

However, I tried this snippet and put it as my correspond template
(neatening out the formatting a little), but I see no sign of the header
in the mail that is sent out at all. 

Right now, my correspond template looks as follows: 


{
    my $retval = undef;
    my $keywdsels = $Ticket->QueueObj->KeywordSelects;
    while ( my $keywdsel = $keywdsels->Next() )
    {
	my $keywds = $Ticket->KeywordsObj( $keywdsel->Id );
	while( my $keywd = $keywds->Next() )
	{
	    $retval .= "X-RT-Keyword: " .
		$keywd->KeywordObj->RelativePath($keywdsel->KeywordObj ) .
		"\n";
	}
    }
    chomp( $retval );
    $retval
}

{$Transaction->Content()}


Am I missing something somewhere? 

Thanks,







More information about the rt-users mailing list