Integration query for population from BSM

Hi, we set up an integration and we are able to use the OOTB integration with the "rtsm to cms sync" job (ODBtoCMSSync) job. Now we have some CI's in BSM for which we want to build our own query to sync these CI's to the CMS (uCMDB). We are not sure if we understand very well.

1) Do we have to create these query in uCMDB or BSM?

2) If in uCMDB -> where shall we save it?


Thanks for clarifiying