diff --git a/lib/RT/Report.pm b/lib/RT/Report.pm index 4e2aee59e75..9b32ef4cdfb 100644 --- a/lib/RT/Report.pm +++ b/lib/RT/Report.pm @@ -104,6 +104,10 @@ our %GROUPINGS_META = ( return () unless $queues; my $crs = RT::CustomRoles->new( $self->CurrentUser ); + $crs->LimitToLookupType( $self->RecordClass->CustomFieldLookupType ); + # Adding this to avoid returning all records when no queues are available. + $crs->LimitToObjectId(0); + for my $id ( keys %$queues ) { my $queue = RT::Queue->new( $self->CurrentUser ); $queue->Load($id);