I guess this can be used almost anywhere, but as my colleague wanted it for reporting, I shall put it here :)
Basically a colleague wants to run a report based on the members of a group, but he does not want to maintain the list - especially on scheduled reports. I did not quite find what I was looking for on here, but I found the seeds and created the following
this is a Global Business Rule and is called group_members
the script :
function group_members(group){
var answer = '';
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('group.name',group);
gr.query();