how do remove roles which are inherited from group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2025 01:13 AM
In users profile , Roles are inherited from the groups. But when I removed group from users profile then roles are not getting removed from users profile . They still exists in users profile and now I am not able to remove them manually as they are inherited from group. How to deal with this issue. I have tried using below script as well to remove roles but its now working for me
var gr = new GlideRecord('sys_user_has_role');
gr.addQuery('user','sys_id of the user');
gr.query();
while(gr.next())
{ gr.deleteRecord(); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2025 01:19 AM
see this
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2025 01:26 AM
Hello @VaibhavM ,
As per your approached i tried in my instance its working well( i simply removed group from user form roles also get removed) .Its not best practice to remove group from user instead of that you can remove group member from group roles get automatically revoked.
If it helps you then mark it as helpful and correct for other peoples for their future queries.
Regards ,
Aditya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2025 01:40 AM
Hi @VaibhavM
It’s a problem on the SN side. If you look at this, you might get an idea of what’s happening.
Workaround
On Madrid or later:
- Add system property glide.ui.schedule_slushbucket_save_for_group_roles and set to true. This will cause group role additions or removals to be performed in the background, so it will not be immediately visible on the group and will need a refresh to confirm completion.
- If this works, when using "Edit" on the related list of a user group, you will see an information message at the top:
On a version earlier than Madrid, choose from one of the following workarounds:
- Increase the quota for UI transactions whenever such a long-running operation is performed by going to https://<instance-name>.service-now.com/sysrule_quota.do?sys_id=88fe39123701200024d1973ebebe5dfd. Increase the value to a large number before running this transaction. The default value is 298 seconds.
- Write a simple GlideRecord-based script to perform the same action to add the role to the group in Scripts - Background. The background scripts are not subject to the UI transaction quota checks.
Note that, although the fix for this is with the system property on Madrid, it is not enabled by default on instances.
Related Problem: PRB1180971
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2025 09:50 PM
hello @VaibhavM ,
If you still face issue or if you get message like this
simply perform following steps
1)Set the system property: glide.ui.schedule_slushbucket_save_for_group_roles to false
2) Remove the user to the group
If this help you then mark it as helpful or solution
Regards,
Aditya