Hello RTIR Community,
I’m looking to implement automation within RTIR to set the value of a custom field (CF.{7}) based on the title of a ticket. Specifically, I want the custom field to be set to a predefined value only when the exact phras is present in the ticket title.
I’ve tried implementing a Scrip in RTIR to achieve this functionality, but I’m encountering issues with getting it to work as expected. Here’s the Perl script I’ve attempted:
# This is an RTIR Scrip action code
# Get the current ticket object
my $ticket = $self->TicketObj;
# Get the CustomField object for CF.{7}
my $custom_field = $ticket->CustomFieldObj('CF.{7}');
# Get the title of the ticket
my $title = $ticket->Subject;
# Check if the exact phrase "Test Phrase" is contained in the title
if ($title =~ /\bTest Phrase\b/i) { # Case-insensitive match
# Set the value of CF.{7} to 'CUSTOM FIELD VALUE'
$ticket->AddCustomFieldValue(Field => $custom_field, Value => 'CUSTOM FIELD VALUE');
}
However, this script doesn’t seem to be setting the value of the custom field as expected.
Could anyone provide guidance on how to properly implement this automation within RTIR? Are there any alternative approaches or scripts that could achieve this functionality effectively?
Thank you in advance for your assistance!