how can i set the work notes updated by system administrator

lakng
Tera Contributor

we have a business rule which will set the approvals no longer required, in the business rule we have given the work notes as "approvals are auto mated by system"

but finally the work notes are being updated. but not by the system. with the name of the user who triggered the BR.

so how can i make the work notes updated by system administrator not by the user not triggered the BR

14 REPLIES 14

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

you can use the following script for impersonating as System Administrator in your BR just before updating the Work Notes field:

gs.getSession().impersonate('<sys id of System Administrator>');

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

shall i use the exact content or i have to mention sys_id?

You have to copy/paste the exact sys_id of the System Administrator user, so go to sys_user.list, search for System Administrator and do the following:

 

yes it worked. and how can i interchange the activity log order as work notes has to update later the state changes

find_real_file.png