sys_id for non admin users

Heisenberg
Tera Contributor

Hi Experts,

I am new to servicenow, I am using Kingston

Firstly I wanted to know how sys_id gets generated in servicenow is it through UI actions or business rule, please advice.

My second question is how to get the sys_id for non admin users, I want sysid details for my asset Id  how can I get it please advice the steps.

 

 

8 REPLIES 8

The SN Nerd
Giga Sage
Giga Sage

It is in the URL.

find_real_file.png

Please do not customise the system for this, it is completely unnecessary.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Paul, I want it for asset user not admin.

you can navigate to sys_user_has_role table and then filter based upon the role and then you can click on each user and get the sys_id in the URL as Paul has showed you

find_real_file.png

or when you open the user record who has asset role then you can right click on the header and select the "Copy sys_id" option to copy the sys_id of that particular user.

find_real_file.png

if you want to get the sys_id of all the users who has asset role then you can user below script in the background script to get the user details with sys_id

var gr = new GlideRecord('sys_user_has_role');
gr.addQuery('role', 'PASS THE SYS_ID of the ASSEST ROLE');
gr.query();
while(gr.next())
  gs.print(gr.user.name + ' : '+ gr.user);

to get the sys_id of Asset role you can check below screenshot on sys_user_role table.

find_real_file.png

Chuck Tomasi
Tera Patron

When I encounter a system where I don't have admin access, I usually use the form menu to say Copy URL, then get the sys_id out of that. For example:

find_real_file.png

 

Then I get a URL like this:

 

https://YOURINSTANCE.service-now.com/nav_to.do?uri=sys_embedded_tour_guide.do?sys_id=ed9340ef67303200bde4a82a33415ac1

 

Then I copy and paste the sys_id where I need it.