Self not showing in Direct Reports on User Profile?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2025 01:11 PM
Kind of an odd one, when you look up your own manager on ESC (User Profile widget), you do not show up as a direct report of that person despite being one.
I looked in the widget and it appears that this is by design. I'd like to figure out a way to disable that so that you always show as a direct report. Here is the relevant code snippet from the server script:
//Calculate team
if (data.teamData.manager) {
var teamGR = new GlideRecord("sys_user");
teamGR.addActiveQuery();
teamGR.orderBy("name");
teamGR.addQuery("manager", data.teamData.manager.sys_id);
teamGR.addQuery("sys_id", "!=", data.sysUserID);
teamGR.query();
while(teamGR.next())
data.teamData.members.push(buildUser(teamGR));
}
//Calculate direct reports
var directReportGR = new GlideRecord("sys_user");
directReportGR.addActiveQuery();
directReportGR.orderBy("name");
directReportGR.addQuery("manager", data.sysUserID);
directReportGR.query();
while(directReportGR.next())
data.teamData.direct_reports.push(buildUser(directReportGR));
I would have thought that simply commenting out the line teamGR.addQuery("sys_id", "!=", data.sysUserID); would do the trick but it doesn't, so I may be missing something elsewhere but haven't see any other references.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2025 04:30 AM
@rlugo365 data.sysUserID stores the sys_id of logged in user and the code eamGR.addQuery("sys_id", "!=", data.sysUserID) is written to prevent if the logged in user is manager of himself in user table, i.e. user profile and manager are same.
You are probably not seeing your profile under direct reports because your manager might have more than 3 reports and if you click on "my org chart" button, you will probably see your name.
Below is Only for testing:
The another way to see if this is working is either have only 2 reports of your manager or change your name to start with "aa" in user profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2025 09:33 AM
That doesn't appear to be the case, for instance in our profile we have managers that are listing 5+ direct reports without the need for clicking on my org chart.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2025 10:06 PM
Can you check the behaviour in PDI, I am able to see my profile after clicking on org chart and PDI is oob.