- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2021 09:58 PM
Hello Developers!
I am trying to get only managers in reference field on incident table.
I have tried with manager is not empty condition in reference qualifier, it shows users those have managers.
But I need to get only managers in field.
Please anyone suggest me.
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2021 12:33 AM
Hi,
update as this to show only the managers
var GetUsers = Class.create();
GetUsers.prototype = {
initialize: function() {
},
getOnlyManagers: function(){
var arr = [];
var gr = new GlideRecord("sys_user");
gr.addQuery("manager", "!=", "");
gr.query();
while(gr.next()) {
arr.push(gr.getValue('sys_id'));
}
var arrayUtil = new ArrayUtil();
arr = arrayUtil.unique(arr);
return arr.toString();
},
type: 'GetUsers'
};
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2021 10:01 PM
Hi,
Are you saying you want only those users in the lookup which are managers or some users?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2021 10:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2021 10:15 PM
Hi,
I have shared the script below.
Please check the same
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2021 10:16 PM
Hi,
Yes I have tried the same script but it show same like before.