+ $RT::Logger->error("Argument '$argument' is incorrect.")
+ unless RT::Lifecycle->Load(Type => 'ticket')->IsValid( $argument );
+ return 0;
+ }
+
+ my $lifecycle = $self->TicketObj->LifecycleObj;
+ if ( $new_must_be ) {
+ return 0 unless grep lc($new) eq lc($_),
+ map {m/^(initial|active|inactive)$/i? $lifecycle->Valid(lc $_): $_ }
+ grep defined && length,
+ map { s/^\s+//; s/\s+$//; $_ }
+ split /,/, $new_must_be;
+ }
+ if ( $old_must_be ) {
+ my $old = lc($txn->OldValue || '');
+ return 0 unless grep $old eq lc($_),
+ map {m/^(initial|active|inactive)$/i? $lifecycle->Valid(lc $_): $_ }
+ grep defined && length,
+ map { s/^\s+//; s/\s+$//; $_ }
+ split /,/, $old_must_be;