- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 04:41 AM
Hi Community,
User X left the company and there are multiple approval request pending for his account.
How can we update all approvals from X to Y.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 04:49 AM
Update the approval records with the new approver (replace the old one).
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 11:02 PM
Hi @Anurudh Kumar1,
All the approvals can be updated from X to Y using the below code:
var gr = new GlideRecord("sysapproval_approver");
gr.addEncodedQuery("approver=46d96f57a9fe198101947a9620895886"); //Luke Wilson's sys id (User X)
gr.query();
while(gr.next()){
gr.approver="62826bf03710200044e0bfc8bcbe5df1"; // Abel Tutter's sys ID (User Y)
gr.setWorkflow(false); //Optional line, helpful for not triggering any background br's depending upon this change.
gr.update();
}
I have attached the screenshots for your reference.
Please mark my answer correct if this has solved your problem.
Thanks and Regards,
K. Sai Charan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 04:49 AM
Update the approval records with the new approver (replace the old one).
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 11:02 PM
Hi @Anurudh Kumar1,
All the approvals can be updated from X to Y using the below code:
var gr = new GlideRecord("sysapproval_approver");
gr.addEncodedQuery("approver=46d96f57a9fe198101947a9620895886"); //Luke Wilson's sys id (User X)
gr.query();
while(gr.next()){
gr.approver="62826bf03710200044e0bfc8bcbe5df1"; // Abel Tutter's sys ID (User Y)
gr.setWorkflow(false); //Optional line, helpful for not triggering any background br's depending upon this change.
gr.update();
}
I have attached the screenshots for your reference.
Please mark my answer correct if this has solved your problem.
Thanks and Regards,
K. Sai Charan