Write ACL Code For Incident

Sohini Kar
Tera Expert

I am completely new in Servicenow Development and I am facing issue while writing codes.

My manager has asked me to write an ACL code for below issue:

Your Incident when in closed state.. only the current Assignment group manager should have access to edit State, Summary, Description field.. for others though he is admin .. should not be able to edit them.

 

 

Can anyone help me to write the code and how to execute it?

 

And with that, please let me know how can I learn servicenow coding? It seems quite difficult.

4 REPLIES 4

Chandu Telu
Tera Guru
Tera Guru

Hi Sohini,

Uncheck the admin override in ACL - Write the Write ACL on this table add condition for State - CLose Complete

 

Script

var grpName = current.assignment_group+""

var usrID = g_form.userID; //Get current user ID
var grp = new GlideRecord('sys_user_group');
grp.addQuery('manager', usrID);
grp.query();
if(grp.next()){
answer true
}
else{
answer false
}

 

 

Thanks
Chandu Telu
Please Mark ✅ Correct/helpful, if applicable,

 

Harish KM
Kilo Patron
Kilo Patron

Hi you need to create 3 write ACL for the same

example for state ACL.

You can achieve this in condition itself no need script

with condition state is closed and

assignmentgroup.manager is dynamic ME

Advanced script

answer = true;

Refer attached screenshot. Do the same for summary and description field

 

 

Regards
Harish

I am not able to find assignment group. manager in filters.

You need to click on option show related list in drop down after that you will be able to dot walk

Regards
Harish