Move Incidents from servicenow A to another servicenow B instance

Kanna12
Tera Expert

Hello Team,

 

We have scenarion, our team creates incidents in daily basis in my instance. When ever incidents creates in my instance, we need to move tjose incidents to another instance. This leads to integrate within the 2 instances.

 

Could you please provide the steps to impelement this functionality.

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Kanna12 

 

There are 2 things

Do  you want trun time integration or

You want to just move  all Incident at end of day to Instance B and then both Instance Incident has separate life cycle.

 

In both case the steps are different.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Gangadhar Ravi
Giga Sage
Giga Sage

@Kanna12 Please check below and see if helpful.

 

https://www.servicenow.com/community/developer-forum/servicenow-to-servicenow-bi-directional-integra...

 

Please mark my answer correct and helpful if this works for you.

rambo1
Tera Guru

@Kanna12 

First point : determine what type of authentication needs to be used 

if basic : Create a user with 'itil' role on target instance where your incident should be posted

if Oauth : Create a Oauth profile (system oauth >> application registry) , get client secret, client id etc

Easiest way to get code for integration :

Go to rest api explorer in target instance :

select 'create a record(post)' and table name as incident

in request body use builder and build sample payload

Now go to bottom and client on 'Servicenow script' copy the code and use it in BR of you instance.

condition for BR - after insert on incident table

Sample :

var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://dev000000.service-now.com/api/now/table/incident');
request.setHttpMethod('POST');

//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = 'admin';

request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");
request.setRequestHeader('Content-Type','application/json');
request.setRequestBody("{\"short_description\":\"test\",\"description\":\"ok\"}"); // replace test, ok with current.short_Description and current.description
var response = request.execute();
gs.log(response.getBody());

Above is one way of doing it , you can also create a rest message and call it in BR. Please let me know your case in detail

Kanna12
Tera Expert

Thank you all inputs!

Can we install data replicate Plugin in instance A to replicate data in instance B, by using IDR functionality?

 

Can any one help me, very much appreciate!