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 

As I check the transaction logs, API call to 

/api/now/form/mention/record/

is happening only for the user records that are not associated to record.

 

Caller is being shown even before the transaction is made in the backend and its not a server side call for sure.

Haven't found a way to stop that client side 😞

Please let us know if you are able to tweak it.

 

Regards,

Sumanth

Chaitanya ILCR
Kilo Patron

Hi @Brian Lancaster ,

try updating user query BR with below script

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

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

})(current, previous);

ChaitanyaILCR_0-1746730102039.png

 

found it create a global or task level onload client script  with inherited as true as mentioned above
you can follow the same in any table where you want this to be disabled

 

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

Regards,
Chaitanya

The client script does not work. I have tried it with both isolate script check and uncheck. I also tried it with a brand new incident.

Hi @Brian Lancaster ,

it's working in my PDI 

script used 

ChaitanyaILCR_1-1746735029686.png

 

function onLoad() {
    //Type appropriate comment here, and begin script below

    NOW.recordMembers = {};

}

ChaitanyaILCR_0-1746734932889.png

do you see any console errors?

 

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

Regards,
Chaitanya