- 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 12:33 AM
Hi @Vaishnavi35 ,
are you trying to achieve it through workflow?
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 01:15 AM
No. Business rule but it does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 01:54 AM
there should be after business rule on RITM, when ritm state changes to close complete ,request should be in closed complete
could you plz share your. business rule script
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact
Thanks,
Manjusha Bangale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 02:37 AM
(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 (gr.next()) {
gr.state = 'closed_complete';
gr.update();
}
})(current, previous);
But the code does not work.