How to interconnect two instances of service-now using a web service?

Not applicable

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

8 REPLIES 8

Hi Mark, I have a slight problem though making the communication between the two instances bi-directional.
...

var req = new SOAPRequest(endpoint, username, password);
req.setSoapAction("http://www.service-now.com/incident/insert");
req.post(env);

var xml_str = req.getResponseDoc(); // returns a string representation of the XML response
var xmldoc = new XMLDocument(xml_str); // instantiating an XML Document
var str = xmldoc.getNodeText("sourceFieldOnTheOtherInstance"); //parse the return value and extract useful data
current."fieldToBeSet".setValue(str);

...

Any idea?

Thank you in advance!
Michael


The example I gave you is to push an incident from one system to another system. If that's what you're doing then you shouldn't need to try to pull values and set them in 'current.'.


What if I want to pull values? Let's say there is a modification on the one instance and we want to update the incident on the other one and the other way round. In short, how could I make them communicate for any modification in the two directions? Thanks


You'll want to push rather than pull. You push because the record that changes is the only one that knows a change has taken place. There's no need to pull if you just use the web service I sent you.