5 my $searches = RT::Attributes->new(RT->SystemUser);
6 $searches->Limit( FIELD => 'Name', VALUE => 'SavedSearch' );
7 $searches->OrderBy( FIELD => 'id' );
9 while (my $search = $searches->Next) {
10 my $content = $search->Content;
11 next unless ref $content eq 'HASH';
12 next unless ($content->{SearchType} || '') eq 'Chart';
14 # Switch from PrimaryGroupBy to GroupBy name
15 # Switch from "CreatedMonthly" to "Created.Monthly"
16 $content->{GroupBy} ||= [delete $content->{PrimaryGroupBy}];
17 for (@{$content->{GroupBy}}) {
18 next if !defined || /\./;
19 s/(?<=[a-z])(?=[A-Z])/./;
22 my ($ok, $msg) = $search->SetContent($content);
23 RT->Logger->error("Unable to upgrade saved chart #@{[$search->id]}: $msg")