
- 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
‎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
‎09-21-2015 11:51 AM
Brad thank you for the information. Based on the information that you provided, I will take this advice. I've advised the customer that this should not be done because the OOB functionality already in place to auto close when all of the items are completed or cancelled. In addition, other functionality has been put in place for RITM's, etc. where this update could have a negative impact.
So we will leave this alone for now and revisit if the issue arise again in the future.
Your advice is much appreciated.
Karen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2017 05:29 AM
Hi Brad Tilton,
can you please share the code what kind of script we have to write here..
i have created BR , but not working....
Script is:
(function executeRule(current, previous /*null when async*/) {
var request=current.request;
var ge=new GlideRecord('sc_request');
gr.addQuery('sys_id',request);
ge.query();
if(gr.next)
{
ge.request_state='closed_incomplete';
gr.update();
}
})(current, previous);
- 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);