7 RT->Logger->debug("Going to correct arguments of NotifyGroup actions if you have any");
9 my $actions = RT::ScripActions->new( RT->SystemUser );
11 FIELD => 'ExecModule',
12 VALUE => 'NotifyGroup',
15 FIELD => 'ExecModule',
16 VALUE => 'NotifyGroupAsComment',
22 foreach my $r ( @{ $arg } ) {
24 next unless $r->{'Type'};
25 if( lc $r->{'Type'} eq 'user' ) {
26 $obj = RT::User->new( RT->SystemUser );
27 } elsif ( lc $r->{'Type'} eq 'group' ) {
28 $obj = RT::Group->new( RT->SystemUser );
32 $obj->Load( $r->{'Instance'} );
39 return join ',', @res;
43 while ( my $action = $actions->Next ) {
44 my $argument = $action->Argument;
47 if ( my $struct = eval { Storable::thaw( $argument ) } ) {
48 $new = $converter->( $struct );
50 $new = join ", ", grep length, split /[^0-9]+/, $argument;
52 next if $new eq $argument;
54 my ($status, $msg) = $action->__Set( Field => 'Argument', Value => $new );
55 RT->Logger->warning( "Couldn't change argument value of the action: $msg" )