how to know that the role is Active or Inactive.

MohdShahidA4585
Tera Contributor

Hi @Experts,

 

I am working on one of the requirements on the role's cleanup. I need to know how we can get the report weather roles are active or not.

 

Thnaks 

Shahid

2 REPLIES 2

glideFather
Tera Patron

ahoy @MohdShahidA4585,

 

roles just exist, they cannot be activated or inactivated... they exist unless they are deleted. Navigate to the [sys_user_role] table to see there's no Active field:

https://yourDomain.service-now.com/sys_user_role_list.do

 

So you cannot go and deactivate itil role for example, if you don't want to use it, you just ensure it's not assign to any group nor indiviudals and it would result like it was inactive...

 

Could you then please elaborate more on your requirement? Perhaps you might be interested in roles that are not assigned to anyone? 


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

yashkamde
Giga Sage

Hello @MohdShahidA4585 ,

 

In short roles themselves do not have an Active or Inactive field. A role record in the Role table (sys_user_role) simply exists in the system unless it is permanently deleted.

 

Also for role cleanup, you can use the User Roles [sys_user_has_role] table and create a report/list with filters such as:

  • User → Active = true/false
  • Role → Name = <specific role's>

This will help you identify which roles are currently assigned to active users and which may be candidates for cleanup.

 

Refer this :
How to Identify Active Users with a Specific Role in ServiceNow 

 

If my response helped mark as helpful and accept the solution.