License utilization by user - Report

Lenin2
Tera Contributor

Hi All,

 

Do we have any option to get the list of users who are not utilizing their fulfiller role on a period basis.

 

Example:

If user "A" has ITIL role but logs into instance on a daily basis but not utilizing the role "ITIL".

 

Requirement:

Is their a way to get the report which lists out User "A" utilized the "ITIL" role last on "Specific time".

 

Thanks in Advance for your help !

 

 

 

2 REPLIES 2

Community Alums
Not applicable

Hi @Lenin2 ,

To get the list of users who are not utilizing their fulfiller role on a periodic basis in ServiceNow, you can use the following steps:

  1. Create a new Scheduled Script Execution record. You can do this by navigating to "System Scheduler" -> "Scheduled Script Execution" in the ServiceNow instance.

  2. Set the "Run" field to "Daily" or another appropriate frequency for your needs.

  3. In the "Script" field, enter the following script:

var gr = new GlideRecord('sys_user');
gr.addQuery('active', true);
gr.addQuery('user_name', '!=', 'admin'); // exclude admin user, if needed
gr.query();

while (gr.next()) {
  var userSysId = gr.getValue('sys_id');
  var fulfillerRoles = new GlideRecord('v_user_role_fulfiller');
  fulfillerRoles.addQuery('user', userSysId);
  fulfillerRoles.query();

  if (!fulfillerRoles.hasNext()) {
    gs.info('User ' + gr.getValue('name') + ' has not utilized their fulfiller role.');
    // You can perform additional actions here, such as sending an email to the user.
  }
}
  1. Save the Scheduled Script Execution record.

This script retrieves all active users in the ServiceNow instance (excluding the admin user), checks if they have any fulfiller roles assigned to them, and logs a message if they do not. You can modify the script as needed to perform additional actions, such as sending an email to the user or their manager.

 

If you're stessing on Report, then 

you can use the following steps:

  1. Navigate to the "Reports" application in ServiceNow.

  2. Click on "Create New Report" and select the table where you want to create the report. In this case, we will select "sys_user_role".

  3. In the "Report Filters" section, add the following filters:

  • User is the specific user you are interested in
  • Role is ITIL
  1. In the "Columns" section, add the following columns:
  • User (displayed as "User Name")
  • Role
  • Last Login Time
  1. In the "Sort" section, sort the report by Last Login Time in descending order.

  2. Save the report with a descriptive name.

 

Community Alums
Not applicable

Hi @Lenin2 ,