- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2016 02:15 PM
I have added a condition to an approval step to handle system cancellation of a requested item when the approval has been pending for 15 days. This image shows what the stage looks like on two different requested items, one rejected and the other cancelled.
Please ignore the new stages "Request Cancelled" and "Rejected", which were added so I could compare different test scenarios. The issue is when an approval is cancelled, it shows "Completed" with a green check mark. I would prefer it to say "Cancelled" and then something similar to the red X shown for rejected. You can see the same rendering when viewing the requested item from the Order Status:
Does anyone know how to customize this?
Thanks!
Kristen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 06:25 AM
We resolved the issue with the "Request Cancelled" stage showing a green check mark. This icon is linked to the approval status. By setting the approval status to rejected, I now see the item is cancelled with a red x.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2016 03:19 PM
Hi Kristen,
Please go through the below link for more info
http://wiki.servicenow.com/index.php?title=Workflow_Stages#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2016 09:03 PM
HI Pradeep,
I looked through this article previously but I'm not seeing where it addresses my specific issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 10:56 AM
In case anyone else is dealing with a similar need, this is what I did in this instance:
I have a scheduled job that finds approval tasks that are a certain age (I have not activated the time on this script, it's still "On Demand"). This script I found on another community question and adjusted to my needs:
cancelOutstandingApprovals();
function cancelOutstandingApprovals(){
var appr = new GlideRecord('sysapproval_approver');
appr.addQuery('state','requested');
//appr.addQuery('sys_created_on', '>', gs.minutesAgo(5));
appr.query();
while (appr.next()){
appr.state = 'cancelled';
appr.update();
//gs.log('Approval for: ' + appr.Name,'Cancel Approvals');
var ritm = new GlideRecord('sc_req_item');
var doc = appr.document_id;
//gs.log('Requested item is: ' + doc,'Cancel Approvals');
ritm.addQuery('sys_id', doc);
ritm.addQuery('approval', "!=", 'cancelled');
ritm.query();
if (ritm.next()){
ritm.approval = 'Cancelled';
ritm.comments = 'System cancelling request due to no response from approver within 15 days.'
ritm.stage = 'cancelled';
ritm.update();
gs.eventQueue("requestitem.approval.cancelled", ritm, gs.getUserID(), gs.getUserName());
gs.log('Cancelling task ' + appr.sysapproval.number + " as approval was not received from " + appr.approver.name,'Cancel Approvals System Job');
}
Then, I've updated the workflow so that I have a "Cancelled" route from the approval step that Closes the Request Item as Incomplete, then rolls back to a check to see if the request item is closed incomplete. If it is, then I set a stage of "Request Cancelled":
The only remaining concerns I have with this solution is that the view for end users is confusing because it shows "Request Approved (Approved)" and then "Request Cancelled (Completed)" with a green check mark. I'm pending some feedback from our consulting company on whether either of these can be modified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 06:25 AM