Hello,
I would like to use RTFM for translating security advisories and need to
automatize the “Extract article from ticket” to CERTAIN CUSTOM FIELDS of a
certain class.
Is it possible to make it using scrips? Or perhaps I am going the wrong way?
This is how i was trying to create a new article and automatically set the
custom fiel values (however it does’t work):
Custom condition:
if ($self->Ticket->Status eq ‘new’) and ($self->Ticket->QueueObj->Name
eq ‘advisory’) and (self->Ticket->RequestorAddresses eq ‘sec-adv@secunia.com’)
{return 1;}
else
{return 0;}
Custom action cleanup code:
my $FROM = self->Ticket->RequestorAddresses;
$self->Class->LoadByCols(Name => ‘$FROM’);
my $Article = new RT::FM::Article($RT::FM::SystemUser);
$Article->Load(self->Article());
$CustomField->Load($self->CustomField());
my %Array = (
‘TITLE:’ , ‘’,
‘SECUNIA ADVISORY ID:’ , ‘’,
‘VERIFY ADVISORY:’ , ‘’,
‘CRITICAL:’ , ‘’,
‘IMPACT:’ , ‘’,
‘WHERE:’ , ‘’,
‘SOFTWARE:’ , ‘’,
‘DESCRIPTION:’ , ‘’,
‘SOLUTION:’ , ‘’,
‘PROVIDED AND/OR DISCOVERED BY:’ , ‘’
);
while(<>)
{
chomp;
$_ =~ s/\s+//;
if (defined($Array{$}))
{
$indexas = $;
}
elsif ($indexas ne ‘’)
{
push(@{$Array1{$indexas}}, $_);
}
}
foreach $myField (keys %Array) {
foreach $myContent (@{$Array1{$myField}}) {
$self->AddCustomFieldValue(
Field => $myField’,
Content => $myContent
)
}
Any help how to fill the RTFM custom fields with certain text from a RT ticket
would be appreciated.
Vaida vaida.alisauskaite@ktu.lt