Child incident's resolved date should be same as the parent incident's resolved date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 12:17 AM
Hi All,
I have a requirement that the child incident's resolved date should be same as the Parent incident's resolved date. How to achieve this?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 12:35 AM
Hi @phr
Create a New Business Rule.
Table : Incident
When to run : After Update
Filter : State Changes to Resolved(6)
Advance: tick
Script:
if (current.state == '6' /Resolved/) {
var resolvedDate = current.resolved_at;
var childInc = new GlideRecord('incident');
// Query for child incidents, adjust "parent" to your reference field
childInc.addQuery('parent', current.sys_id);
childInc.query();
while (childInc.next()) {
// Set the child incident’s resolved date to match the parent
childInc.resolved_at = resolvedDate;
childInc.update();
}
}
Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2024 08:10 AM
Thank you, this worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2024 01:00 PM
Hi @phr
Please mark it as Accepted Solution, this will help others for the same requirement.
Thanks & Regards
Deepak Sharma