Need to change the Approver for Knowledge article

Anurudh Kumar1
Tera Contributor

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.

2 ACCEPTED SOLUTIONS

Mark Manders
Mega Patron

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

View solution in original post

Sai_Charan_K
Kilo Sage

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

View solution in original post

2 REPLIES 2

Mark Manders
Mega Patron

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

Sai_Charan_K
Kilo Sage

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