Modifying Custom Fields in a Custom Scrip

Hi all,

I’m attempting to implement a custom scrip (via the web interface) to
automatically modify a custom field when a new ticket is created. If
the requestor of the ticket matches a string (e.g., from user then set the ‘Severity’ Custom Field value to be
’Critical’. However, I’m not doing it correctly and am not sure why…
My current code results in the error "Custom field Severity not found"
being logged.

I am by no means a skilled or experienced perl coder, so please forgive
any horrible errors or poor methods… Any assistance is appreciated…

my $email;
my @emails;
my $result = 0;
my $resultmessage;

@emails = $self->TicketObj->Requestors->MemberEmailAddresses();

open LOG, “>>/opt/rt3/mylog”;
print LOG @emails, “\n”;

foreach $email (@emails) {
print LOG $email, ": ";

if ($email =~ /.someuser./i) {
($result, $resultmessage) =
$self->TicketObj->AddCustomFieldValue(Field => ‘Severity’, Value =>

print LOG $resultmessage, "\n";

} else {
print LOG “none\n”;

close LOG;

return ($result);