
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 07:12 AM
I would like to know the best practice for making these updates.
I am working on a project to update all workflows for all catalog items to ensure that everything is consistent. I've done that part, but upon TESTING out the changes. It has come to my attention that when an approval is rejected the RITM's State / Stage are correct, but the REQ Approval & Request State are not.
I've tried updating the workflow directly to include the request.request state = Closed Rejected but that didn't seem to add any value.
Should this be done via a UI Action or UI Policy?
Thanks,
Karen
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 08:05 AM
Hi Karen,
Typically the request auto-closes when all of the items are completed or cancelled. If you're wanting to close the request when someone rejects an approval in one of the items, then all of the other items associated with the request would close too. Is that what you're wanting to do?
I think to close the request you would need to use a GlideRecord in a run script activity. The Set Values activity only works on the current record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2025 06:47 AM
Hi Kishore,
There are couple of mistakes in the script. Please try below.
(function executeRule(current, previous /*null when async*/) {
var request=current.request;
var gr=new GlideRecord('sc_request');
gr.addQuery('sys_id',request);
gr.query();
if(gr.next())
{
gr.request_state='closed_incomplete';
gr.update();
}
})(current, previous);