Script action to run as different user instead of system for encryption context

qili
Tera Contributor

Hi all 

we have a integration to sending value of a field to 3rd party application. We wanna do the encryption for that field and give the context to a user (or service account). However, the script action is running as system so system don't have access to the encrypted field, which we sending the encrypted value instead of the actual value. 

I tried the getDisplayValue(),which giving me blank.

I tried the gs.getSession().impersonate('sys_id_of_user') , which not working since encryption context is not working with impersonation. 

Is there a way to access the System ?   or  is there a way to make encryption context works when running as other user instead of system? 

Is there any way to achieve this?  

Any best practice for this would be great help for us.

 

Thanks

 

2 REPLIES 2

Tony Chatfield1
Kilo Patron
Hi, have you looked at glideimpersonate api? https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=GlideImpersonateAPI

Eric Feron
Moderator
Moderator

Hi qili,

does this solve your question?