Maik Skoddow
Tera Patron
Tera Patron

find_real_file.png

 

When implementing a complex rights and roles concept, it is often necessary to use the impersonate function of ServiceNow for testing the correctness of the rights adjustments. And even as a service desk agent, it is often necessary to impersonate as the ticket creator in for reproducing the described problem. Therefore, it would be really helpful, if impersonating could be triggered just by one click.

But even impersonation takes time and every additional click adds up to a considerable amount at the end of the day.

 

 

 

Faster Impersonating

 

To accomplish this, I developed a new UI action "Impersonate" for the sys_user and sys_user_has_role tables, which can be used in both the list view and the record view to trigger an impersonation in a new browser tab.:

 

find_real_file.png find_real_file.png

 

However, the most useful feature is the UI Macro "impersonate_user" that can be used on any field with a reference to the sys_user table, for example at field "Caller" on Incident records:

 

find_real_file.png

 

To configure the UI Macro at the desired field:

  1. Right-click on the field label and choose "Configure Dictionary":

    find_real_file.png


  2. Add dictionary attribute "ref_contributions=impersonate_user". If the "ref_contributions" attribute already exists, the macro name can be added separated with a semicolon, for example "ref_contributions=user_show_incidents;impersonate_user":

    find_real_file.png

 

 

Faster Unimpersonating

 

While impersonating a user, it would be helpful to unimpersonate with a singe click only, for example via a link or icon in a central place.

 

In my article Inject a custom icon into the header bar of the Next Experience UI I have demonstrated how you can offer functionalities in a central place - the header bar - and for a faster unimpersonating I reused that idea.

 

With the help of an additional UI Script a crossed-out eye icon is injected into the header bar to allow unimpersonation with a single click:

 

MaikSkoddow_0-1706241383910.png

 

 

 

How to get everything

 

All required artifacts are bundled in an Update Set published on Share: https://developer.servicenow.com/connect.do#!/share/contents/4067296_faster_impersonating.

 

Version history
Last update:
‎01-25-2024 07:58 PM
Updated by:
Contributors