We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69c730d commit 01437e7Copy full SHA for 01437e7
Server-Side Components/Background Scripts/Get all users where manager is empty/Yser where Manager is Empty.js
@@ -0,0 +1,18 @@
1
+(function() {
2
+ var users = [];
3
+ var userGr = new GlideRecord('sys_user'); // used different variable name instead of gr.
4
+ userGr.addActiveQuery(); // only active users
5
+ userGr.addNullQuery('manager'); // users with no manager
6
+ userGr.query();
7
+
8
+ var count = 0; // Initialize count
9
10
+ while (userGr.next()) {
11
+ // Include Sys ID along with display name
12
+ users.push('\n' + userGr.getDisplayValue() + ' (Sys ID: ' + userGr.getUniqueValue() + ')');
13
+ count++; // Increment count
14
+ }
15
16
+ gs.info("Users without manager are: " + users.join(''));
17
+ gs.info("Total users without manager: " + count);
18
+})();
0 commit comments