- 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:07 PM
I tried this one but not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:10 PM
Have you written the Business rule and condition of Business rule would be Before-update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:12 PM
Check the parent back-end name once. OOB its parent_incident
- 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:28 PM
I changed backend name of parent incident. Now its working. Thank you @Sonam_Tiwari @Prince Arora