Hello,
On Wed, Aug 24, 2016 at 6:17 AM, PeterMairGO <[email protected]> wrote:
> Hello,
> I'm scripting a custom condition before a email will be sent.
> I've tryed this: ($self->TicketObj->FirstCustomFieldValue('Solution') =!
> 'NULL')
Unfortunately, at a minimum, your perl is wrong. You were looking for
'!=', not '=!'. However with strings you want 'ne' instead of '!='.
The latter is for numeric comparisons.
my $a = 'Hi';
if ($a ne 'Goodbye') {
print "Good.\n";
}
Some more things...
What version of RT are you running?
I would try a little script like this to test things out:
#!/usr/bin/perl
use strict;
use warnings;
use lib qw(
/opt/rt4/lib
/opt/rt4/local/lib
);
use RT -init;
my $t = RT::Ticket->new(RT->SystemUser);
$t->Load($ARGV[0]);
my $cf = $t->FirstCustomFieldValue('Solution');
if (defined $cf) {
print "$cf\n";
}
else {
print "__NOT_DEFINED__\n";
}
-m
---------
RT 4.4 and RTIR training sessions, and a new workshop day!
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017