- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 10:55 AM
I am attempting to build a report on the sys_user table for all inactive users that are listed as a 'Knowledge Manager' for all of our Knowledge Bases (basically anyone who has the knowledge or knowledge_manager role). I am having trouble determining which knowledge bases these inactive users are managers on. Also, are there any additional filters on the report I can add to drill down the results? I attempted to build the report on the kb_knowledge_base table the only option I found would be to show the knowledge base owner with the knowledge base name, not the managers. Any suggestions?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2025 12:04 AM
Hello @eastonreedy ,
This cannot be achieved with a report because the Managers field on the Knowledge Base record is a list.
But you can run the following background script to get the information:
var grKB = new GlideRecord('kb_knowledge_base');
grKB.addQuery('active', 'true');
grKB.addNotNullQuery('kb_managers');
grKB.query();
while (grKB.next()) {
var grUser = new GlideRecord('sys_user');
grUser.addQuery('sys_id', 'IN', grKB.getValue('kb_managers'));
grUser.addQuery('active', 'false');
grUser.query();
while (grUser.next()) {
gs.info(gs.getMessage(
'Inactive manager {0} found for Knowledge Base {1}',
[grUser.getDisplayValue(), grKB.getDisplayValue()]));
}
}
Example output:
*** Script: Inactive manager Abel Tuter found for Knowledge Base IT
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2025 12:04 AM
Hello @eastonreedy ,
This cannot be achieved with a report because the Managers field on the Knowledge Base record is a list.
But you can run the following background script to get the information:
var grKB = new GlideRecord('kb_knowledge_base');
grKB.addQuery('active', 'true');
grKB.addNotNullQuery('kb_managers');
grKB.query();
while (grKB.next()) {
var grUser = new GlideRecord('sys_user');
grUser.addQuery('sys_id', 'IN', grKB.getValue('kb_managers'));
grUser.addQuery('active', 'false');
grUser.query();
while (grUser.next()) {
gs.info(gs.getMessage(
'Inactive manager {0} found for Knowledge Base {1}',
[grUser.getDisplayValue(), grKB.getDisplayValue()]));
}
}
Example output:
*** Script: Inactive manager Abel Tuter found for Knowledge Base IT
Regards,
Robert