How to hide activity fields

JohnDF
Mega Sage

How do I hide the part mark in Red for specific users?

I prefer doing that using ACL but if it is not possible so client script will do the job as well.

 

JohnDF_0-1683988646556.png

 

 

Thx

6 REPLIES 6

Andrew_TND
Mega Sage
Mega Sage

Hi

I've never done this before, however try the below on load client script.

function onLoad() {
try{    

jQuery(".sn-widget-list-table-cell:contains(System Administrator')").each(function( index ) {
jQuery( this ).closest(".h-card")
                .children(".sn-card-component_accent-bar ")
                .css('cssText', 'display:none'); // or visibility: hidden
});
	
jQuery(".sn-widget-list-table-cell:contains('System Administrator')").each(function( index ) {
jQuery( this ).closest(".h-card")
                .children(".sn-card-component_accent-bar ")
                .css('cssText', 'display:none'); // or visibility: hidden
});	
}
	catch (err){
		message.innerHTML = "Error: " + err + ".";
	}

	
}

Please mark as helpful or if this has resolved the issue, correct!

Hi @Andrew_TND thanks for reply,

 

this clinet script is not working. Still everythin is visible. And for what stants the "System Administrtor?" This screenshot is just an example I want to hide the author from the activities and not what is written there. For example customer comments. Just the name should hide because of anonymize. But hide the complete acitvty log if with not pissble to just hide the author(red marked port in the screenshot)

 

Thanks for your help.

Sumanth16
Kilo Patron

Hi,

 

Try creating a read ACL on the sys_history_line table and control that with either a role or condition, etc.

Alternatively...you can create a section that just contains the activity log (in form design) and then hide that section based off of role (via client script)? Use this thread for example:

https://community.servicenow.com/community?id=community_question&sys_id=5e1f03e1dbdcdbc01dcaf3231f96...

 

Please mark it as helpful (or) correct if it resolves your issue.

 

Thanks & Regards,

Sumanth Meda

Hi @Sumanth16 

 

I created multiple acl for testing. But still for example itil user can see the activity notes 

JohnDF_0-1684079239230.pngJohnDF_1-1684079258635.png

But why?

 

And I dont want to hide the full activites? Just the red marked part, so hide the author of the activity log.

Thanks for input