[rt-users] Adding a CustomField to a ticket?

Howard Jones howard.jones at network-i.net
Tue Oct 18 05:51:04 EDT 2005


Hi,

I've been experimenting this morning with a scrip to extract information 
from some fields in a ticket, and fill in some additional information in 
a customfield, based on those fields. The scrip works, but only if the 
ticket was created in the appropriate queue, and not moved there.

Apparently, if it was moved into the queue, it doesn't gain the CFs for 
that queue. Unfortunately, the way we have RT setup, almost all mails go 
into General before being re-filed by us (we don't trust our customers 
to categorise their problem, basically). Is there a way to add a CF to a 
ticket from within a scrip, or alternatively, is there something else I 
need to do to inherit a CF when the ticket moves?

My script action is currently:

   my $tick = $self->TicketObj;
   my $requestor = $tick->RequestorAddresses;
   my $cf = $tick->QueueObj->CustomField('OutageSource');

   if($requestor ne "")
   {
         $tick->DeleteWatcher(Type=>'Requestor',Email=>$requestor);
         $tick->AddCustomFieldValue(Field=>$cf,Value=>$requestor);
         $RT::Logger->warning("Removing requestor, adding CF value");
    }
    return 1;

I have a couple of similar but more involved scrips I was planning to 
write, but obviously I'd like to get past this bit first!

Thanks in advance,

Howard




More information about the rt-users mailing list