Disable @mention in activity steam

Brian Lancaster
Tera Sage

I tried to follow How to Disable Activity Stream Mentions in Helsinki but is is not working for me. As soon as you type in the @ symbol in work notes or comments it is still querying the users table. I used log statements and I can see that is is going into the if statement in the BR but its like it is skipping the addNullQuery. Any ideas on why this is happening?

Correction: It is working unless you try to mention someone associated with the task. For example I'm testing with an incident. If I mention either the caller or the assigned to there name still appears. How do I prevent that as well?

(function executeRule(current, previous /*null when async*/ ) {

    try {
        if (GlideTransaction.get().URL.startsWith('/api/now/form/mention/record/')) {
            current.addNullQuery("sys_id"); //All records have a sys_id so we are filtering out all records
        }
    } catch (e) {
		
    }
})(current, previous);

 

16 REPLIES 16

SumanthDosapati
Mega Sage
Mega Sage

@Brian Lancaster 

  1. Users associated to record are stored client side when the form is loaded.
  2. The api call /api/now/form/mention/record/ is only to fetch remaining users and on demand when we start typing after @
  3. The preloading of users associated to record are processed by the system processor 
    > Goto sys_processor table and filter with name 'NGListHistoryDirectProcessor'
  4. And as suggested by @Chaitanya ILCR it is working by clearing out the NOW.recordMembers object
  5. To check what it stores you can do below :
    a) Open an incident form
    b) Open browser console (F12)
    c) Type this and click enter "Object.values(NOW.recordMembers).map(u => u.name)"
    d) This will print all names of the users associated to record which are preloaded for @.

Regards,

Sumanth

Brian Lancaster
Tera Sage

I created an idea for this to have an OOB way to be able to disable this.

https://support.servicenow.com/ideas?id=view_idea&sysparm_idea_id=3d0f2d8b9319aa50def533527cba10d9&s...