- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 03:04 PM
I want to set child incidents state to close after parent state is closed by using business rule
here is my approach tell me where I'm wrong
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 03:36 PM
Hello
PLEASE replace your script like below.
Child incidents are stored on parent field so you need to glide record with parent field
And also change your condition from state is closed to stage changes to closed
var gr= new GlideRecord('incident');
gr.addQuery('parent',current.sys_id);
gr.query();
while(gr.next())
{
gr.state=7;
gr.update()
}
Please mark my answer correct if it helps you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 03:34 PM
Hi Ravi, You may find the below thread helpful.
-Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 03:36 PM
Hello
PLEASE replace your script like below.
Child incidents are stored on parent field so you need to glide record with parent field
And also change your condition from state is closed to stage changes to closed
var gr= new GlideRecord('incident');
gr.addQuery('parent',current.sys_id);
gr.query();
while(gr.next())
{
gr.state=7;
gr.update()
}
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 04:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 04:04 PM