How to track users activity to optimize licenses?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 10:50 AM
Several users have been granted both ITIL and Approver roles. Due to no governance and process gaps, many users have got additional roles which is not needed for them.
Ex - Few users are just doing the approvals in the instance but have got ITIL role also.
Is there a way to know if users who have got ITIL role are actually doing fulfiller activities? If not, are they doing any approvals? If not, we need to remove the roles.
PS - We sent multiple emails to group managers to validate this for their group members but its difficult to coordinate and follow up with them as its a huge organization with several licensed users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 11:03 AM - edited 05-09-2025 11:05 AM
Hi @Suggy ,
var gr = new GlideRecord("sys_user_has_role");
gr.addEncodedQuery('role=282bf1fac6112285017366cb5f867469') //itil
gr.query();
while (gr.next()) {
var taskgr = new GlideRecord('task'); //find if any tasks assigned to them
taskgr.addEncodedQuery('sys_class_nameINincident,problem,change_request,sc_task^assigned_to=' + gr.getValue('user')) //extend this list
taskgr.query();
if (!taskgr.hasNext())
gr.deleteRecord(); //remove itil role
}
1 way is by seeing if any tasks are assigned to the users who have itil role(extend this by adding time frame too if notask is assigned to user in last 1year remove role or something) and no task is assigned to them and remove the role for that user
do the same with approver role
create a schedule job for this to run daily to perform this activity if you adding time frame of no task is assigned in last one year else take this as a 1 time activity (better include timeframe so that newly role assigned users are not impacted)
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya