I am currently working on a phased project in an Service-now.com instance that will temporarily integrate with an older service-now.com instance until all phases are complete within the new instance.
As I considered my options, I realized that I could use SOAP Web Services to synchronize this data. However, upon careful reading I found a semi-undocumented way to remotely send and retrieve data from another Service-now.com instance in a way very similar to “GlideRecord”.
This Java class is named: RemoteGlideRecord.
Here is a nifty way of querying all of the incidents in the “Demo” instance at Service-now.com using the RemoteGlideRecord class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | // Set up the remote connection info var RemoteGlideRecord = Packages.com.glide.communications.RemoteGlideRecord; var remote_instance = "https://demo.service-now.com"; var table_name = "incident"; var r = new RemoteGlideRecord(remote_instance, table_name); // Set up the authentication var username = "admin"; var password = "admin"; r.setBasicAuth(username, password); // Perform the query r.addQuery("incident_state", "Active"); r.query(); while( r.next() ){ gs.print("Short Description: " + r.getValue("short_description") + " (P): " + r.getValue("priority")); } |