- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2025 09:22 AM
Hi All,
I have a field name called Support group in cmdb_ci table and that field value needs to be populated in Assignment group in change_request table if I select Configuration item in change_request table in ServiceNow. Business rule before Insert and update to be created
(function executeRule(current, gsr) {
// Check if CI is set
if (current.cmdb_ci) {
var ciGR = new GlideRecord('cmdb_ci');
if (ciGR.get(current.cmdb_ci)) {
// If CI has a support group, use it
if (ciGR.support_group) {
current.assignment_group = ciGR.support_group;
return;
}
}
}
})(current, gsr);
The above code is not working for me, kindly suggest.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2025 09:33 AM
you can simply dot walk and set and no GlideRecord needed
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
current.assignment_group = current.cmdb_ci.support_group;
})(current, previous);
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
06-24-2025 09:33 AM
you can simply dot walk and set and no GlideRecord needed
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
current.assignment_group = current.cmdb_ci.support_group;
})(current, previous);
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
06-24-2025 10:07 AM
Thank you, it worked!!