sys_user_has_role table contains empty roles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2024 09:13 PM
One or more (empty) Roles in User profile and are inherited, unable to remove /delete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2024 09:17 PM
Include this to fix script and run in lower instance
var gr = new GlideRecord('sys_user_has_role'); gr.addEncodedQuery(INSERT YOUR QUERY HERE); gr.query(); while(gr.next()){ gr.inherited = false; gr.setWorkflow(false); gr.autoSysFields(false); gr.update(); }
Regards,
Shyamkumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2024 09:49 PM
Hi there,
Can you share an example? And please be more specific with what you exactly mean with unable to remove/delete.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2024 11:19 PM
Hi @Mayuri1711 ,
There is a Servicenow support article related to this please refer the below,
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0781684
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2024 11:44 PM
Hi @Mayuri1711 ,
Can you please share the any example or screenshot as that table having all roles details .
You can refer the below.
https://www.servicenow.com/community/now-platform-forum/empty-users-in-user-roles/m-p/1097189
Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
Thanks
AJ
Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/
ServiceNow Community Rising Star 2024