I apologize for the confusion. It looks like there was a typo in my previous response. The function name should be `recurseUser` instead of `recurseUsers`. The updated function name should be:
```
function recurseUser(manager, level, maxLevel, userList) {
var emp = new GlideRecord('sys_user');
var filter = new GlideFilter('OR');
var filter1 = filter.addQuery('manager', manager);
var filter2 = filter.addQuery('sys_id', manager);
filter1.addOrCondition('sys_id', manager);
emp.addEncodedQuery(filter.getXML());
emp.addQuery('active', true);
emp.query();
while (emp.next()) {
userList.push(emp.getValue('sys_id'));
if (level + 1 <= maxLevel) {
recurseUser(emp.getValue('sys_id'), level + 1, maxLevel, userList);
}
}
}
```
Regarding the issue with the empty array, it's possible that the `userList` array is empty due to the query conditions. Make sure that the `managerSysId` parameter is a valid sys_id of a manager in the `sys_user` table, and that the manager has active subordinates up to the specified `maxLevel`.
Also, make sure that you're calling the `getSubordinates()` method correctly and passing in the `managerSysId` parameter. Here's an example of how you can call the method:
```
var myScriptInclude = new MyScriptInclude(); // Replace with the actual name of your script include
var managerSysId = '1234567890abcdef1234567890abcdef'; // Replace with the actual manager sys_id
var subordinates = myScriptInclude.getSubordinates(managerSysId);
// Do something with the subordinates list
```
If you're still having issues, please let me know and I can try to help you further.