- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 10:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:16 PM
Good Catch!! @Sonam_Tiwari
Please try to update the script as below:
Also your BR should be before update
var gr = new GlideRecord('incident');
gr.addQuery('active',true);
gr.addQuery('parent_incident',current.sys_id);
gr.query();
if(gr.next())
{
current.setAbortAction(true);
gs.addInfoMessage("Please close all the child incidents first and try again!!");
}
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:01 PM
Hi,
You can create after update Business rule and you can write your condition there if child incidents are open then you can use setAbortAction(true) to abort the parent incident action when state changes to Resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:07 PM - edited 11-26-2023 11:09 PM
You can write a before update business rule and use the below script there
var gr = new GlideRecord('incident');
gr.addQuery('active',true);
gr.addQuery('parent',current.sys_id);
gr.query();
if(gr.next())
{
current.setAbortAction(true);
gs.addInfoMessage("Please close all the child incidents first and try again!!");
}
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:22 PM
Hello prince,
Before update also not working. I resolved parent ticket when child incident is in in progress. Parent ticket should not be resolved when child ticket is in inprogress
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:25 PM - edited 11-26-2023 11:26 PM
Then add an additional check -