I am attempting to populate a previously created CustomField (“Assigned_Group”) for a ticket with the group name, which is created in a different script from the domain name from the requestor’s email address. (I’m repeating the process of pulling the domain name here, but at some point I’ll circle back and pull it from the group name that’s been created). I’m unable to determine why I’m getting the error “Invalid value for custom field” as a return in my scrip.
# Custom Scrip action to populate a custom field with the group name
my $ticket = $self->TicketObj;
# Get the requestor's email address
my $requestor_email = $ticket->RequestorAddresses;
# Extract domain from email address
my ($domain) = $requestor_email =~ /\@(.+)$/;
# Create group name based on the domain
my $group_name = "Group_$domain";
# Get the custom field name
my $custom_field = $ticket->QueueObj->CustomField('Assigned_Group');
# Update custom field value with the group name
my ($st, $msg ) = $ticket->AddCustomFieldValue(Field => $custom_field, Value => $group_name);
$RT::Logger->debug("CUSTOM FIELD: Status: $st Msg: $msg");
return 1;
EDIT- One additional thought- I’ve tried a few different permutations of this script, including changing the Value field to a simple string like Value => 'TestValue'
and I still get the same error, so it’s not like it’s rejecting it because the variable points to like a hashed value or something.