How to get CurrentUser's GroupId?

Hi All - I have a page /Elements/GrpRequests that
should show the tickets requested by all the members
of CurrentUser’s Group, I have this piece of code in
it but it doesn’t work, pls help!:

my $UserObj = new RT::User($session{‘CurrentUser’});
my $rows = 50;
my $Query;
my $QueryString = “”;
my $GroupMembers =
RT::GroupMembers->new($session{‘CurrentUser’});
my $Group = RT::Group->new($session{‘CurrentUser’});
$GroupMembers->Limit( FIELD => ‘MemberId’, VALUE =>
$UserObj->Id );
while ( my $GroupMember = $GroupMembers->Next ) {
$Group->Load($GroupMember->GroupId);
}

$Query = “RequestorGroup = '”.$Group."’ AND ( Status =
‘new’ OR Status = ‘open’)";

$QueryString = ‘?’ . $m->comp(’/Elements/QueryString’,
Query => $Query,
Order => ‘DESC’,
OrderBy => ‘Priority’)
if ($Query);

Thanks,
Weq

Yahoo! for Good
Donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/