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

This works but only in the standard UI. If it try it in SOW which we are looking at it does not work. 

Actually the BR I mentioned above does not work in SOW either.

Hi @Brian Lancaster ,

 

The BR I share works in both standard and Workspaces but

the client script doesn't work in workspaces

 

use either the first one or this Query BR on user table

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

	if(gs.action.getGlideURI().toString().contains('api/now/form/mention/record/')){
		current.setLimit(0);
	}
	
})(current, previous); 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

I'm using your BR it does not work for me in Service Operations Workspace.

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

	if(gs.action.getGlideURI().toString().contains('api/now/form/mention/record/')){
		current.addNullQuery('sys_id');
	}

})(current, previous);

The problem I'm having is that if I do a gs.log(gs.action.getGlideURI().toString()) the URI that is returned does not contain api/now/form/mention/record/. I tried this in both my instance and my PDI. It returns api/now/v1/batch?api=api which seems to generic to use.

For me this worked instead if gs.action

GlideTransaction.get().URL.startsWith('/api/now/form/mention/record/'