update the list type field on a parent incident with multiple child incidents with unique values
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2024 11:46 PM
I need to update a parent incident list type field with values from multiple child incidents. Each child incident is meant to pass a unique value to the parent incident to aggregate the vlaue in the parent incident.
My script updates the parent incident field, but when a new chield incident is related, the value of the field changes to the value of the newly related child incident. (replaces the value, not add)
How do i fix this? I am using a business rule.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var parentincident = new GlideRecord("incident");
parentincident.addQuery('sys_id', current.parent_incident);
parentincident.query();
if (parentincident.next()) {
parentincident.u_user_location=current.u_user_location;
parentincident.update();
}
})(current, previous);
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2024 11:59 PM
Hi @Richard Tyler ,
Try updating this line
parentincident.u_user_location += current.u_user_location;
Thanks,
Danish