Write ACL Code For Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 12:38 AM
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.
- Labels:
-
Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 12:52 AM
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,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 01:06 AM
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
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 11:53 PM
I am not able to find assignment group. manager in filters.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 11:55 PM
You need to click on option show related list in drop down after that you will be able to dot walk
Harish