Restrict @mention suggestion to Requested by/Requested for, watclist and fulfillers only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 05:47 AM
Hello Everyone,
We are currently utilizing the @mention and our client wants to limit the suggestions to Requested by/Requested for, watchlist, and fulfillers(assigned to) only. I based my business rule script on this discussion.
Is there any way to achieve it?
Thank you
Business Rule: Before Query
Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 06:10 AM
HI @Vee Jay Recana ,
In the current platform there is no out-of-the-box supported way to change the behavior of the @mention feature. It is not possible to:
1 - Not return users who can not see the record
2 - Limit the @mention feature to certain roles (e.g. only users with the itil role)
3 - Disable the @mention feature
It is possible to implement a customization to disable the @mention feature, or restrict it to certain roles, based on a workaround described in this Community article:
https://community.servicenow.com/community?id=community_question&sys_id=1bf50761db1cdbc01dcaf3231f96...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 06:19 AM
Hi @Community Alums , thank you for your quick response. I just have one small question. Is it possible to use addEncodedQuery to filter the users from Requested By/For, watchlists, and fulfillers? I was trying it on my PDI but I can't get the correct syntax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 08:51 AM
One clarification to the response above. You mentioned It is not possible to #3 disable the @mention feature. We disabled it in our instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 06:24 AM
Hi @Vee Jay Recana ,
, if there are multiple conditions in query, the conditions are ANDed. To use ORs or create technically complex queries, use encoded queries. The code for using an encoded query looks like this:
var myObj = new GlideRecord("x_snc_needit_needit");
myObj.addEncodedQuery('<your_encoded_query>');
myObj.query();
while(myObj.next()){
// Logic you want to execute for the GlideRecord records
}
Use this script for your refernce :