How to Share Reports access to at a time for multiple support group

sahana1998
Tera Contributor

How to Share Reports access to at a time for multiple support groups.

Ex: I have a requirement to share the report access to 90 groups.

 

Please can any one help on this.

 

6 REPLIES 6

I guess you can't select the multiple group at a time and you need to select only one at time then other..

 

 

Community Alums
Not applicable

Hi @sahana1998 

Can you please try in your fix script:

var list = "05c5f47b1b96194240xy5332bb4axi9a";// group sys_id list to whom you want to share report
var arr = list.split(",");

gs.print("array count: " + arr.length);
for(i=0;i<arr.length;i++){

gs.print("Adding permissions");
	var rep = new GlideRecord('sys_report');
	rep.addEncodedQuery('titleSTARTSWITHCMDB');// add your encoded query , for report name condition
	rep.query();
	if(rep.next()){
		var usr = new GlideRecord('sys_report_users_groups');
		usr.initilize();
		usr.group_id = arr[i];
		usr.report_id = rep.sys_id;
		usr.insert();
                // uncomment next line to include print statement on the permission addition
                // gs.print("Added permissions for " + usr.group_id + " (" + usr.group_id.getDisplayValue() + ") to read " + rep.title); 
	}
}