From 1fad5e63d2f86cdb3b46fcb63c6dcda25cb56c12 Mon Sep 17 00:00:00 2001 From: bharakm Date: Sun, 19 Oct 2025 16:43:17 -0500 Subject: [PATCH 1/2] Create readme.md --- Client-Side Components/UI Actions/Show Direct Reports/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Client-Side Components/UI Actions/Show Direct Reports/readme.md diff --git a/Client-Side Components/UI Actions/Show Direct Reports/readme.md b/Client-Side Components/UI Actions/Show Direct Reports/readme.md new file mode 100644 index 0000000000..498daaabb8 --- /dev/null +++ b/Client-Side Components/UI Actions/Show Direct Reports/readme.md @@ -0,0 +1 @@ +UI action to see user active direct reports in new tab list view From 6039a1e735c673aba01b7c922328aa61cd6f7a06 Mon Sep 17 00:00:00 2001 From: bharakm Date: Sun, 19 Oct 2025 16:43:30 -0500 Subject: [PATCH 2/2] Create script.js --- .../UI Actions/Show Direct Reports/script.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Client-Side Components/UI Actions/Show Direct Reports/script.js diff --git a/Client-Side Components/UI Actions/Show Direct Reports/script.js b/Client-Side Components/UI Actions/Show Direct Reports/script.js new file mode 100644 index 0000000000..2b038eec84 --- /dev/null +++ b/Client-Side Components/UI Actions/Show Direct Reports/script.js @@ -0,0 +1,24 @@ +/* +This script should be placed in the UI action on the table sys_user context menu . +client is unchecked +*/ + + +try { + + var user = new GlideRecord('sys_user'); + user.addQuery('active', true); + user.addQuery('manager', current.getUniqueValue()); + user.query(); + var count = user.getRowCount(); + if (count == 0) { + + gs.addInfoMessage('No Direct Reports found for the user.'); + } else { + gs.addInfoMessage(count + ' Direct Reports found for the user.'); + } + action.setRedirectURL('sys_user_list.do?sysparm_query=active!=false^manager=' + current.getUniqueValue()); // //Redirects to the list view + +} catch (e) { + gs.addErrorMessage('Failed in showing direct reportees ' + e); +}