Filter @Mention for Work Notes

CJB
Tera Expert

Hi, everyone. I had a question about mentions. For work notes, is there a way to filter the names to only display users who have the ITIL role? Some of the users with the ITIL role sometimes forget that work note mentions only work for ITIL users and non-ITIL users will not get the mention emails. I did a lot of searching, but could not find anything. Thank you.

1 ACCEPTED SOLUTION

sachin_namjoshi
Kilo Patron
Kilo Patron

You need to configure On Before Query BR on Table "sys_user"

 

Condition: gs.getSession().isInteractive() && gs.action != ''

 

Script:

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


 


try


{


if(gs.action.getGlideURI() != '')


{


if(gs.action.getGlideURI().getMap()!= '')


{


if(gs.action.getGlideURI().toString().startsWith('api/now/form/mention/record/'))


current.addEncodedQuery('roles=itil');


current.addActiveQuery();


}


}


}


catch(errObj)


{


gs.error('Global_Set_Filter_Mention-'+errObj);


}


 


})(current, previous);

 

View solution in original post

6 REPLIES 6

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

No it is hard to do this. It is inbuilt functionality so might not be possible.


Thanks,
Ashutosh

sachin_namjoshi
Kilo Patron
Kilo Patron

You need to configure On Before Query BR on Table "sys_user"

 

Condition: gs.getSession().isInteractive() && gs.action != ''

 

Script:

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


 


try


{


if(gs.action.getGlideURI() != '')


{


if(gs.action.getGlideURI().getMap()!= '')


{


if(gs.action.getGlideURI().toString().startsWith('api/now/form/mention/record/'))


current.addEncodedQuery('roles=itil');


current.addActiveQuery();


}


}


}


catch(errObj)


{


gs.error('Global_Set_Filter_Mention-'+errObj);


}


 


})(current, previous);

 

Thank you very much. Before I try to implement, would this only affect mentions in Work Notes or both Work Notes and Comments? 

Hi,

 

For above it is not specific to Worknotes or Comments i.e. anywhere you try to use @Mention feature it will show only record of Users with ITIL role because the rule above will look for URL & if it has /mention keyword it will execute regardless of the field that you are on.