Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
How often we come across cases where report created by one user needs to be shared with multiple users. We can use the 'Share' option but will be time consuming.
Imagine being able to do it via script by just passing sys_id of users.
Use this script to share report in bulk by executing it as Background script
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var list = "4b6c76e3dbcfaf0000ec7abe3b961912,9e67d6d1db736300d43c54e848961934"; //pass user sys_id here who needs access to reports
var arr = list.split(",");
for(i=0;i<arr[i].length;i++){
var rep = new GlideRecord('sys_report');
rep.addEncodedQuery('sys_created_by=abc@gmail.com');//replace with appropriate user mail who creaed the report
rep.query();
if(rep.next()){
var usr = new GlideRecord('sys_report_users_groups');
usr.initilize();
usr.user_id = arr[i];
usr.report_id = rep.sys_id;
usr.insert();
}
}
Loading