Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Find delegate user user list through background script

Nitya2
Kilo Guru

Hi All,

Kindly let us know background script to get   'user - delegate user'   details , we were having many user having delegations.

kindly let us know to get those in list ?

we have to know their roles also . 'user-delegate-delegate role' details.

kindly help us.

 

1 ACCEPTED SOLUTION

Use this

var gr = new GlideRecord('sys_user_delegate');
//gr.addQuery('user', gs.getUserID());
gr.query();
gs.print('total delegates = '+gr.getRowCount())
if(gr.next()) //use while here if there can be more then 1 entries and youw ant to print all
{
gs.print('User = '+gr.user.user_name + ' has delegate = '+gr.delegate.user_name);
}
-Anurag

View solution in original post

11 REPLIES 11

Thank you Anurag  , Its working i got require details

Cheers!

-Anurag