One of the more advised best practices, of scripting in ServiceNow, is to not hardcode the sys_id. Accordingly, we need to create a system property, where we would be able to store the sys_id or even the instance link. Then our script can use gs.getProperty() to retrieve the record and use the sys_id.
var ID = gs.getProperty('my_sys_property');
You can create the property by opening the [sys_properties] Table:

And then creating an adequate record:

Recent Comments