How to Hide Attachements, Description and Notes for incidents assigned to Edge Support

nameisnani
Mega Sage

Hi Team , 

 

can anyone please help me on this requirment . 

 

How to Hide Attachements, Description and Notes for incidents assigned to Edge Support .

 

Except edge support , admin it should show , for other user it should hide . please provide setps for this 

 

Up until now we have hidden all elements of incidents assigned to  Edge Support from all users who are not members of  Edge Support group or Major Incidsent Managers - This however is proving to be frutrating for the AUDIT team who are unable to report on incident volumes and other governance elements as these incidents are no visisble to them - Another option is to hide the fields that contain sensitive PII data instead of hiding the whole tickedt perhaps by using some of the aoptions listed below:

 

Is that possible to hide attachments and specific fields on the Incident form for specific users or groups .

 

can anyone please provide me the detailed configuration steps to achieve this requriment .

 

if possible please provide screenshots for better understanding .

 

Thanks in davnce 

5 REPLIES 5

Chaitanya ILCR
Kilo Patron

Hi @nameisnani ,

try this

to hide the description and notes better go with Deny unless read ACL

ChaitanyaILCR_0-1746601658636.png

update appropriate groups

var checkUserInGroup = Class.create();
checkUserInGroup.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    _checkUserInGroup: function(userName, group) {
        return gs.getUser().getUserByID(userName).isMemberOf(group);
    },
    checkUserInGroupAjax: function() {
		return this._checkUserInGroup(this.getParameter('spmuserName'),this.getParameter('spmgroup'));
    },

    type: 'checkUserInGroup'
});

onload client script with isolate script as false

function onLoad() {
    var ga = new GlideAjax('checkUserInGroup')
    ga.addParam('sysparm_name', 'checkUserInGroupAjax')
    ga.addParam('spmuserName', g_user.userName);
    ga.addParam('spmgroup', 'Edge support'); //update correct group name
    ga.getXMLAnswer(function(ans) {
        if (!(ans == 'false' || g_user.hasRole('admin'))) {
            //Type appropriate comment here, and begin script below
            hide('header_add_attachment'); //hides paper clip icon
            hide('header_attachment'); // hides attachment bar
            g_form.setDisplay('description', false);//better go with ACL for this
        }
    });
}

 

 

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

Regards,
Chaitanya

 

J Siva
Tera Sage

Hi @nameisnani 

I suggest creating 'Deny Unless' ACLs on the Incident and Sys Attachment tables.

Sample:
Incident.description: (Modify the group name as required & create similar one for the worknotes)

JSiva_0-1746601979026.png

JSiva_1-1746602009041.png

if (gs.getUser().isMemberOf('Service Desk')) {
    answer = true;

} else {
    answer = false;
}

 

sys_attachment ACL:

JSiva_2-1746602636520.png

JSiva_3-1746602657792.png

answer = false;
var inc = new GlideRecord('incident');
inc.get(current.table_sys_id);
var group = inc.getDisplayValue('assignment_group');
if(group!='Service Desk'){ //CHANGE GROUP NAME
	answer = true;
}else{
	if(gs.getUser().isMemberOf(group)){
		answer = true;
	}else{
		answer = false;
	}
}

 

Regards,
Siva

nameisnani
Mega Sage

@J Siva @Chaitanya ILCR 

 

Along with attachment , i want hide worknotes as well , please provide your inputs for this 

@nameisnani 
Create one more ACL with similar configuration as I mentioned earlier.
Under name, select "work_notes" instead of description.

JSiva_0-1746606005478.png