How to interconnect two instances of service-now using a web service?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2009 06:10 AM
I was wondering how we can be able to create a link between two instances of service-now so that they can exchange their data. For example, while creating an incident on the one instance the other one will be informed and vise-versa...
I was thinking of creating a client solution using JavaScript, make the call to the Web service and parse the result within the JavaScript code. This could be done by opening the connection to the server, passing the appropriate headers and sending the appropriate request XML... Tried all without success 😞
Any help would be very much appreciated!
Thanks/Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2009 06:28 AM
I wonder if there's a simpler solution, depending on what you want to accomplish. For the example of creating an instance, you might want to have the two instances exchange data using Email Notifications / Inbound Email Actions.
Obviously, if you want to do this across a number of tables for a number of purposes, the notifications/inbound email actions system might be inefficient.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2009 07:02 AM
Thanks for your reply but I'm looking for a solution using a web service...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2009 10:23 AM
I just tested this script against the SNC demo instance. You can put it in a business rule to be run against the incident table. This isn't going to give you the complete picture but it should give you a good start.
If you're going to go straight from one table to another then you'll probably want to have a separate business rule for inserts vs. updates. If you're okay with using web service import sets then you could still use something like this that would point to the import set table and then you could use a transform map to coalesce, etc.
http://wiki.service-now.com/index.php?title=Web_Service_Import_Sets
SubmitIncident();
function SubmitIncident(){
var endpoint = "https://demo.service-now.com/incident.do?SOAP";
var username = "itil";
var password = "itil";
var env = new SOAPEnvelope();
env.createNameSpace("xmlns:inc", "http://www.service-now.com/incident");
env.setFunctionName("inc:insert");
//Populate the fields
env.addFunctionParameter("inc:caller_id", current.caller_id);
env.addFunctionParameter("inc:short_description", current.short_description);
var req = new SOAPRequest(endpoint, username, password);
req.setSoapAction("http://www.service-now.com/incident/insert");
req.post(env);
//gs.addInfoMessage(req.getResponseDoc()); // print out the whole response XML
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2009 01:26 AM
Thanks a lot!!! You are now putting me on the right piste. Michael