User Tools

Site Tools


modu

Welcome to our U section


User Itil Check JS

ClearUserLog();
var gr = new GlideAggregate('sys_user');
gr.addEncodedQuery('roles=itil');
gr.addAggregate('COUNT');
gr.query();
while (gr.next()) {
    UserLog(gr.getAggregate('COUNT'));
}

User Information JS

// get user information --input user sys id in brackets.
ClearUserLog();
var userInfo = gs.getUser("6816f79cc0a8016401c5a33be04be441");
UserLog("g_user.firstName = " + g_user.firstName +
    ", \n g_user.lastName = " + g_user.lastName +
    ", \n g_user.userName = " + g_user.userName +
    ", \n g_user.userID = " + g_user.userID +
    ", \n gs.getUser().roles = " + gs.getUser.roles); // if it doesnt work, remove last line

—–

modu.txt · Last modified: 11/29/2023 06:06 by johnsonjohn