Parent RITM should be closed only when all Child RITMS close completed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2022 12:35 AM
Hi All,
we was creating one Parent RITM with few records data once the RITM is approved automatically it will create different child RITM's based on the records selected in parent RITM.
only when all the child RITM's gets close completed the parent RITM should closed completed.
I was using WAIT FOR CONDITION in Workflow but its not waiting till all child to complete.
Thanks,
Naveen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2022 12:40 AM
Hi Naveen,
You may try with BR with below configuration,
BR configuration:
Table="sc_req_item"
Condition : State changes to closed complete
Script:
Write a script to check if all child of current parent record are closed and close RITM accordingly.
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2022 12:43 AM
Hi Abhijit,
BR will have performance issue so max we need to use Workflow only.
Thanks,
Naveen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2022 01:07 AM
Yes, right. Please share what you have written in wait for condition so that we can help you further.
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2022 01:24 AM
Hi Abhijit,
var parentritm = current.sys_id;
var request = new GlideRecord('sc_req_item');
request.addQuery('parent', parentritm);
request.addQuery('active', 'false');
request.query();
var count = request.getRowCount();
if (count == 0) {
answer = true;
}
Thanks,
Naveen