[rt-users] Using Keywords in Scrips

Bruce Campbell bruce_campbell at ripe.net
Tue Aug 13 05:20:48 EDT 2002


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.

-- 
                             Bruce Campbell                            RIPE
                   Systems/Network Engineer                             NCC
                 www.ripe.net - PGP562C8B1B             Operations/Security

{ 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 }






More information about the rt-users mailing list