how to find non admin user in service now

Nag9
Tera Expert

How to find non admin user in servicenow, he must have permissions to raise Ritm

1 ACCEPTED SOLUTION

Can you add the log statement  in the script include after this line and tell me the log output.

     var thisUser = gs.getUser().getUserByID(userID);

gs.log("Group name is "+groupName+"----"+userID);

 

View solution in original post

93 REPLIES 93

Yes checked, while the time of  raising ticket  its not impacting for read-only mode.

After opening the same record it is impacting to read only mode

show me the output of non-admin once.

for non-admin this should return false

g_form.addInfoMessage(g_user.hasRole('admin'));

 

find_real_file.png

 

Yes its return false only. Might we need change the view i think

 While raising ticket assignment group is not showing in form, After i opened the same ticket assignment group is showing

 

Hi,

The first line "Entered into the fucntion"false is coming from script include.

The 2nd line g_form.addInfoMessage(g_user.hasRole('admin')); returned empty, because of which it might be not working at the 1st time.

try liek this. in the client script, add this line above this IF condition 

if ((answer == 'false') && !g_user.hasRole('admin')) {

var isAdmin = g_user.hasRole('admin');
var answer = "false";
if (isAdmin.length >0 && isAdmin) {
isAdmin=true;
} else {
isAdmin=false;
}

Then change the IF condtion to below


if (answer == 'false' && !isAdmin) {

 

and let me know the output.

 

Thats the problem.

So you need to call this onchange of assignment group instead of onload and try.