- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 12:28 AM
Hi,
Once the RITM is closed the REQ is not closing.
RITM's having tasks or workflows are involved REQ is getting closed correctly.
But the RITM's where tasks are not there REQ form is not getting closed.
Help?
Thanks,
Vaishnavi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 03:26 AM - edited 06-30-2023 03:30 AM
Hi @Vaishnavi35 ,
try this
(function executeRule(current, previous /*null when async*/ ) {
var grReq = new GlideRecord('sc_request');
grReq.addQuery('sys_id', current.request);//get the request from RITM
grReq.query();
if (grReq.next()) {
grReq.request_state = 'closed_complete'; //add your field name
grReq.update();
}
})(current, previous);
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 02:25 AM
Hi Mark,
this is for all the workflows where tasks are not involved, where the workflow is basic as the screenshot attached in the question and here
I do not see any OOB BR in my instance, I will verify in PDI though once.
Thanks,
Vaishnavi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 03:16 AM
Yeah oke but that's by your design choice. Now you have nothing in your workflow that would set the stage correct on your RITM and therefore the out-of-the-box business rule won't take care of the REQ.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 04:22 AM
Hi Mark,
Instead of updating each workflow with state/state, would like to go for BR.
Can you please let me know the name of the BR? the OOB one ??
I do not find it in my instance.
Thanks,
Vaishnavi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 04:32 AM
Hmmm good lesson to learn from such then also applying subflows, if having done that, you would have to update only that single subflow and that's it.
Anyway, out-of-the-box business rule which handles this, this is how I found it:
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 07:27 AM
Hi @Vaishnavi35 ,
If you want to stick with OOB instead of creating custom BR's then I would recommend the following:
1. Open the 'End Activity' in the Workflow.
2. Set the stage to 'Completed'.
It would work because there are OOB Business rules which will call script includes to check the stage in the triggered WF end activity before updating the REQ to closure based on RITM state.