- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 02:16 AM
I have written business rule to change acknowledged value as true on on-call scheduling table if incident is assigned. But it is not working, can someone help me to resolve it.
Table- Incident
When- After Update
Condition- Assigned to is Not Empty
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('on_call_escalation');
gr.addQuery('source',current.sys_id);
gr.query();
while(gr.next())
{
gr.acknowledged=true;
gr.update();
}
I have already deactived OOB ACL which allows users with maint role to write operation on on-call escalation table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 02:42 AM
ACL won't come into picture as you are using GlideRecord and not GlideRecordSecure.
Your BR condition should be this
Assigned To [Changes] AND Assigned to [IS NOT EMPTY]
Things to check
1) did you add log and see if query ran?
2) are you using correct source field to query and correct acknowledge field?
var gr = new GlideRecord('on_call_escalation');
gr.addQuery('source', current.sys_id);
gr.query();
while (gr.next()) {
gs.info('Record found');
gr.acknowledged = true;
gr.update();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 02:22 AM
Hi @SakshiBagal ,
create a new ACL(write and read(if already doesn't have)) or reactivate the ACL and give a role(ITIL or any relevant role) and try
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 02:38 AM
I have added log in script and it is showing source value as undefined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 02:42 AM
ACL won't come into picture as you are using GlideRecord and not GlideRecordSecure.
Your BR condition should be this
Assigned To [Changes] AND Assigned to [IS NOT EMPTY]
Things to check
1) did you add log and see if query ran?
2) are you using correct source field to query and correct acknowledge field?
var gr = new GlideRecord('on_call_escalation');
gr.addQuery('source', current.sys_id);
gr.query();
while (gr.next()) {
gs.info('Record found');
gr.acknowledged = true;
gr.update();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader