- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2019 12:08 AM
How to find non admin user in servicenow, he must have permissions to raise Ritm
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2019 03:57 AM
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2019 05:17 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2019 05:19 AM
show me the output of non-admin once.
for non-admin this should return false
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2019 05:22 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2019 05:37 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2019 05:38 AM
Thats the problem.
So you need to call this onchange of assignment group instead of onload and try.
g_form.addInfoMessage(g_user.hasRole('admin'));