in servicenow, i want that when my approval get approved then i have one field in RITM form named as parent incident, so my assignment group will auto populate with the assignment group in parent incident
Assistant
To achieve this in ServiceNow — when the approval on your RITM gets approved, you want to automatically populate the Assignment Group field on the RITM form with the assignment group from the Parent Incident referenced in a field — you can do this using a Business Rule or a Flow/Flow Designer.
Assumptions
Your RITM has a reference field called parent_incident (which references the Incident table).
Approval process updates the RITM's approval status field (e.g., approval or approval_state) to approved.
You want the Assignment Group field on RITM (field name assignment_group) to be updated with the assignment group from that linked parent incident.
Option 1: Using a Business Rule (Server-side Script)
Create a Business Rule on the sc_req_item (RITM) table that triggers after update when approval is "approved".
Steps:
Navigate to System Definition > Business Rules
Click New
Configure:
Name: Set Assignment Group from Parent Incident on Approval
Table: sc_req_item (RITM)
Advanced: Checked
When: after
Update: checked
In the Condition field, put a simple condition that the Approval just got approved:
(This triggers only when approval changes to approved.)
In the Script field, add the following:
javascript
(function executeRule(current, previous /*null when async*/) {
if (!current.parent_incident)
return; // no parent incident selected
var incidentGR = new GlideRecord('incident');
if (incidentGR.get(current.parent_incident)) {
current.assignment_group = incidentGR.assignment_group; // copy assignment group from parent
current.update(); // update current RITM record
}
})(current, previous);
Notes:
You need to replace "parent_incident" with your exact field name on RITM referencing the incident, if different.
The Business Rule runs after the RITM is updated and approval changes to approved.
current.update() inside an after update Business Rule is generally safe if you want to reupdate record. Alternatively, you can switch to Before Update and just set: