Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Report showing all tickets raised by members of multiple assignment groups

Alex Saager1
Tera Contributor

Hi,

 

I'm trying to run a report showing any ticket type (so I'm running this on the task table) created over a month by members of multiple assignment groups, I cannot see anyway to do this other than user the operator "opened by" and select all the individuals manually.

 

Have anyone done this before?

 

Many thanks,

 

Alex

1 ACCEPTED SOLUTION

@Alex Saager1 

it's not simpler.

you will require scripting approach for this

1) create client callable classless script include and use this script

function fetchTickets(){
	try{
		// get the group members
		var memberArr = [];
		var member = new GlideRecord('sys_user_grmember');
		member.addQuery('group.name', "IN", "Service Desk,Network Team,EUC Team"); // give the correct group names here
		member.query();
		while(member.next()){
			memberArr.push(member.getValue('user'));
		}

		return memberArr.toString();
	}
	catch(ex){
		gs.info(ex);
	}
}

2) then call it like this in filter condition of report

Opened By.SysId [IS ONE OF] javascript: fetchTickets()

 

AnkurBawiskar_1-1700147663300.png

 

OR

Another approach is to to create database view of task and sys_user_grmember and then create report on that database view table

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Thank you @Ankur Bawiskar worked perfectly 🙂