How to restrict the list of users/users with specific role when using @mention?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 11:06 PM
Hi Team,
When an ITIL member uses @mention function in "Worknotes" it should list only the members/users with ITIL role but currently its listing all the users on search.
In below screenshot, Approver user doesn't have itil role and holds only approver_user role but still its displaying.
Kindly help!
Sujatha V.M.
- Labels:
-
Incident Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 12:27 AM
Hi Sujatha,
I doubt that can be achieved & so does the HI document that states the same. Give it a check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 12:56 AM
Hi Sujatha,
I don't know any official way to disable it but you can prevent the query on your user table coming from this API with a Before Query business rule.
You could even have some conditions, like role conditions to allow specific roles to do mentions or even add a query based on a specific criteria like a user can see users from his own department or something like that. However, this Business rule will make the @ mention look like a broken feature if no users are available.
Warning: GlideTransaction is an undocumented Java object, ServiceNow could decide to retire it or to change it's behavior without any notice.
If my answer helped you in any way, mark answer as helpful and correct.
Thanks and regards,
Megha.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2021 05:43 AM
Hi Megha,
I tried your business rule, it seems to work except that it still shows the name of the caller.
There is any way to avoid that? I want to display only itil role users.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 12:58 AM
Hello Megha, i have try this business rule and it is working on only Dev Platform but not on Agent workspace. why it is happening?
(function executeRule(current, previous /*null when async*/) {
try{
if(GlideTransaction.get().URL.startsWith('/api/now/form/mention/record/')){
current.addQuery('roles', 'itil');
}
}
catch(e){
}
})(current, previous);