Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to create the catalog task integration from one instance to another instance

sainath reddy
Tera Contributor

I'm having a task.

I have a requirement of integrating these 2 ServiceNow instances for service request:

instance 1                   instance 2

req    -->                         req

ritm   -->                         ritm

task   -->                         task

does any body having a script to complete this requirement and how to do it? and what NameSpace and TABLE do we use in Rest API Explorer.And can anybody have a demo script?

3 REPLIES 3

Chetan Mahajan
Mega Sage

Hello @sainath reddy ,

           Please refer this thread it might help you SNOW To SNOW Bidirectional Integration (REST) / YouTube : Integration between two ServiceNow instances 

 

Kindly mark correct and helpful if applicable

In business rule we can only use one table at a time so..for sc_req, sc_req_item and sc_task we have to create three business rules. 

and one more question is how to merge RITM into REQUEST and catalog task into RITM.if we create three business rules.

Hello @sainath reddy ,

                                      Yes you need to create 3 BR To handle the integration of sc_req, sc_req_item, and sc_task between two ServiceNow instances, you will need to create three separate business rules, each targeting the respective tables.
Instance 1                                                                               Instance2

Request create                                                                     Request create

RITM Create(Pass Request sysid )                      RITM Create with Instance 1 request

Task Create (pass RITM sys_id)                          task create and attached with RITM sys_id

 

Merging RITM into REQUEST:

-Create a business rule on the sc_req_item table in Instance 1 that triggers when a new RITM is created.

-In the script of this business rule, use the REST API or a script include to create a corresponding RITM record in Instance 2.

-After successfully creating the RITM in Instance 2, you can use the sys_id of the newly created RITM to update the 'request' field on the sc_req_item record in Instance 1 with the sys_id of the REQUEST (req) created in Instance 2.

 

Merging catalog task into RITM:

-Create a business rule on the sc_task table in Instance 1 that triggers when a new catalog task is created.

-In the script of this business rule, use the REST API or a script include to create a corresponding task record in Instance 2.

-After successfully creating the task in Instance 2, you can use the sys_id of the newly created task to update the 'request_item' field on the sc_task record in Instance 1 with the sys_id of the RITM (sc_req_item) created in Instance 2.

By using this approach, you can maintain the relationship between records in the different instances.