How to successfully roll-back / reset manual approver approval records (change workflow)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2018 08:25 AM
Hi guys, does anyone have any working solutions for how to roll-back manual approver approval records?
Detail:
As part of our revised change workflows we have a 'Manual Approver' activity stage within an approval co-ordinator because of the need to allow change requestors to potentially add manual approvers (as well as the group approver ones that are automatically added).
It's apparent that following a rejection, when approvals are rolled back although all the approval records are correctly reset to 'Requested' (when 'Request approval' is re-clicked), the requirement for the manual approvers to actually approve is not there as seen by the workflow showing that manual approval activity stage as blue i.e. satisfied in terms of progressing the workflow (all the others are green indicating they're waiting approval - see below screen-grab).
I have found that the only way to ensure the manual approvers are required is to manually remove the manual approvers, save, re-add them back and then manually set the manual approver approval records back to 'Requested'!
This seems so clunky right? As such am just wondering whether you have any suggestions (other than not using manual approvers which has been made clear to me this is not an option!) as to how I can make this whole process smoother for change owners who have manual approvers added to their changes.
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2018 08:39 AM
When the rollback occurs what state are the manual approval records set to (before they go back to 'Requested')?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2018 08:59 AM
Hi Mark, the manual approval records could be in 'Approved', 'Rejected' or 'No Longer Required' State - although when I look into the individual approval records, at the point 'Request approval' is clicked (for a 2nd the time following a rejection) the Activity log seems to indicate they're reverting from 'Not Yet Requested' to 'Requested' (I think this is happening as part of the 'Rollback to' activity stage on the workflow). Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2018 09:07 AM
Okay, what I've done in the past to make this work correctly is to make sure that all of the manual approvals are set to 'Not requested' all at the same time right after the rollback. Can you try this in a 'Run script' activity right after your 'Rollback To' activity?
var rec = new GlideRecord('sysapproval_approver');
rec.addQuery('sysapproval', current.sys_id);
rec.addNullQuery('wf_activity');
rec.query();
while(rec.next()){
rec.state = 'not requested';
rec.comments = 'Approval rolled back by change workflow.';
rec.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2018 06:22 AM
Thanks Mark. I created a 'Run script' activity with the above script straight after the 'Rollback' activity shown in the workflow screenshot above however now bizarrely in the change I have tested this with, only one group has had their approval records reset back to 'Requested' (i.e. not the manual approvers and none of the other groups except 'Approvers: Service impact assessors').
To recap, prior to the 'Run script' I was seeing all approval records reset to 'Requested' just with the issue of the workflow not actually requiring any (or all of them as it should be) of the 'Manual approvers' to approve to progress the workflow. Also to confirm, the Manual Approvers activity is sat inside an Approval co-ordinator with the various other group approver activities.
Any more ideas? Thank-you.