- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2022 09:08 AM
Hi,
I need to update the RITM fields for which I'm using a BR with cart api, but RITM fields are not getting updated.
Here is my BR condition:
here is my script:
I need this to parent field to be updated on my RITM and request table also how to achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2022 10:15 PM
Hi,
BR is on sn_customerservice_case table
So you want this case record to be populated inside the RITM's parent field and REQ parent field?
If yes then this can be done
after line 13 query RITM and REQ and update; like this
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var ritm = new GlideRecord('sc_req_item');
ritm.get('request', rc.sys_id);
ritm.parent = current.getUniqueValue();
ritm.update();
var req = ritm.request.getRefRecord();
req.parent = current.getUniqueValue();
req.update();
})(current, previous);
Regards
Ankur
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-15-2022 10:03 AM
I guess you are doing it in wrong way.
You are writing business rule on insert of case record and in script you are using current.variables.opened_by
Do you have a variables formatter on case form?
And in the question you wrote update RITM but you dont need cart api to update an ritm.
Can you tell your business requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2022 10:28 AM
when I create a case in sn_customerservice_case table, I will select the asset (reference field) of alm_asset table, the product field will also auto populate the same. After saving the case form my request should be automatically create for the product which I had raised. So to achieve this I'm writing this BR, now request is getting created but the field values are not populating in ritm itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2022 10:15 PM
Hi,
BR is on sn_customerservice_case table
So you want this case record to be populated inside the RITM's parent field and REQ parent field?
If yes then this can be done
after line 13 query RITM and REQ and update; like this
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var ritm = new GlideRecord('sc_req_item');
ritm.get('request', rc.sys_id);
ritm.parent = current.getUniqueValue();
ritm.update();
var req = ritm.request.getRefRecord();
req.parent = current.getUniqueValue();
req.update();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader