4 $RT::Logger->debug("Going to correct arguments of NotifyGroup actions if you have any");
7 my $actions = RT::ScripActions->new( RT->SystemUser );
10 VALUE => 'NotifyGroup',
13 FIELD => 'ExecModule',
14 VALUE => 'NotifyGroupAsComment',
20 foreach my $r ( @{ $arg } ) {
22 next unless $r->{'Type'};
23 if( lc $r->{'Type'} eq 'user' ) {
24 $obj = RT::User->new( RT->SystemUser );
25 } elsif ( lc $r->{'Type'} eq 'group' ) {
26 $obj = RT::Group->new( RT->SystemUser );
30 $obj->Load( $r->{'Instance'} );
37 return join ',', @res;
41 while ( my $action = $actions->Next ) {
42 my $argument = $action->Argument;
45 if ( my $struct = eval { Storable::thaw( $argument ) } ) {
46 $new = $converter->( $struct );
48 $new = join ", ", grep length, split /[^0-9]+/, $argument;
50 next if $new eq $argument;
52 my ($status, $msg) = $action->__Set( Field => 'Argument', Value => $new );
53 $RT::Logger->warning( "Couldn't change argument value of the action: $msg" )