Updating of approval record through 3rd party inbound Integration

TejaswiniB62848
Tera Contributor

How can I update an approval record through a third-party integration (Postman) so that the Updated by field in the activity log reflects the approver’s name, rather than the integration account?

1 ACCEPTED SOLUTION

palanikumar
Mega Sage

It is possible if you are using Scripted Rest API. You can use below script to impersonate as approver before approving:

var impUser = new GlideImpersonate();
impUser.impersonate("<sys_id of approver>");

 

Thank you,
Palani

View solution in original post

4 REPLIES 4

palanikumar
Mega Sage

It is possible if you are using Scripted Rest API. You can use below script to impersonate as approver before approving:

var impUser = new GlideImpersonate();
impUser.impersonate("<sys_id of approver>");

 

Thank you,
Palani

TejaswiniB62848
Tera Contributor

Thanks Palani for your response.
I have used the above method like gs.getSession().impersonate(<sys_id of the approver>"); and it didn't work properly until i gave admin access to integration account

You need to grant "impersonator" role. Ensure the integration user has approval access and "impersonator" role 

Thank you,
Palani

TejaswiniB62848
Tera Contributor

After granting impersonator role, still it doesn't seem to work. it only approves the specific approval record and blocks the workflow.