- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2022 06:24 AM
I wanted to understand, Since Users and Groups aren't captured in the update sets and if I create a report and share it with particular groups and users in lower environment so when I migrate that update set to other environment, how will the sharing work? Will I have to share the reports to the groups and users of that environment again? How does it work?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2022 07:21 AM
Hi,
Please follow the steps below to achieve your requirement:
You do not need a script here to achieve what you are looking for:
1) Couple of things to make a note of while moving Report shared list. You need to make sure the users with whom you have shared your report with are also available in both the instance with same details so that when you move the report ServiceNow can reference it correctly. I have seen scenario where user were not same and it was showing as blank in Target instance.
You do not need to add Users and Groups manually in your target instance. Navigate to the Table named as "Report Users and groups" by typing "sys_report_users_groups.LIST" in Application Navigator Search menu as shown below:
Now Put a Filter condition as shown and the just Export the filtered record as XML as shown below:
Right click on the header and then select Export-XML as shown below:
Now navigate to your Target instance, and then click on Retrieved Update Set and click on Import XML as shown below:
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2022 06:45 AM
Hi Ayushi,
Yes your right, you need to share the reports to the groups and users of that environment again. As update set do not capture the sharing info.
I hope the answer helps, You can thank me by Marking the answer ✅ Correct or ???? Helpful.
Thanks,
MF Sohail Khilji.
LinkedIn > https://www.linkedin.com/in/mf-sohail-khilji/
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2022 06:49 AM
Thank you!
Just wondering if there is another way to share the migrated reports other than manually?
Incase the number of reports are more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2022 06:54 AM
Yes,
sys_report_users_groups is the table that saves the group/user the report is shared to .
You can write a script and create records which will share the report to user/group..
The below sample script can help you...
var groupsare=new GlideRecord('sys_user_group');
groupsare.addEncodedQuery('active=true');//Pass desired users query here
//groupsare.setLimit(10); //uncomment to check for 10 records
groupsare.query();
gs.print(groupsare.getRowCount());
while(groupsare.next())
{
var sharereport=new GlideRecord('sys_report_users_groups');
sharereport.initialize();
sharereport.report_id.setDisplayValue('TimeCard Trend'); //Pass report name
sharereport.group_id=groupsare.sys_id;
sharereport.insert();
gs.print(sharereport.getRowCount());
}
I hope the answer helps, You can thank me by Marking the answer ✅ Correct or ???? Helpful.
Thanks,
MF Sohail Khilji.
LinkedIn > https://www.linkedin.com/in/mf-sohail-khilji/
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2022 07:02 AM
Hi
transferring reports to other instances inclusive all dependencies like sharing definitions can easily be done via the "Add to update set" feature. I have just tried it out, and you will find the respective records captured in the update set:
But it will one match those groups and users which have the same Sys IDs on the target instance.
Kind regards
Maik