Get Product based on Item group in MSD Ax 2012

To get Item details or  Product based on Item group in Ax 2012 you can try below code in job. In this job Test_InventItemGroup is query on which you need to include inventItemgroupItem and inventTable. I have pass the range TT as item group same way you can use in your customization.
   Query  query;  
   QueryRun qr;  
   QueryBuildDataSource qbds;  
   QueryBuildRange queryBuildRange;  
   InventItemGroupItem IntventTest,InventTest1;  
   query = new Query(queryStr(Test_InventItemGroup));  
   qbds = query.dataSourceTable(tableNum(InventItemGroupItem));  
   queryBuildRange = qbds.addRange(fieldNum(InventItemGroupItem,ItemGroupId));  
   qr = new QueryRun(query);  
     IntventTest= qr.get(tableNum(InventItemGroupItem));  
     select ItemId from IntventTest1  
       where IntventTest1.ItemGroupId == IntventTest.ItemGroupId;