Troubleshooting: CSDM Data Sync for Technical Service Offerings (TSO) This article is for troubleshooting this feature: Synchronize data using a technical service offering (TSO) (docs link)"Synchronize group assignment attributes on entire CI classes and individual CIs using a Technical Service Offering" Table of Contents The Managed by::Manages relationshipSynched FieldsCMDB Group CIsCSDM Data Sync scheduled job Line 30: grRel.addEncodedQuery('sys_created_on>javascript:gs.hoursAgo(25)');Line 32: grRel.addEncodedQuery('parent.sys_class_name=service_offering^child.sys_class_name=cmdb_ci_query_based_service');Line 34: if(util.isTechnicalService(grRel.getValue('parent')) && util.isTechnicalService(grRel.getValue('child'))) {Lines 35-45: Put the new field values from the service_offering record into a JSON objectLine 46: gs.eventQueue('csdm.tso.modified', tso, JSON.stringify(oldValues), JSON.stringify(newValues), 'sn_csdm_tso_queue'); The csdm.tso.modified eventCSDMTSOEventProcessor job Known Problem The "Sync From TSO to CI" Script Action The Managed by::Manages relationship Type = Managed by :: ManagesParent: Technical Service Offering (TSO), Table: Service Offering CI [service_offering], but where field service_classification=Technical Service. Navigate to CSDM > Technical Service Offering Child: Dynamic CI Group, Table: cmdb_ci_query_based_service, also with field service_classification=Technical Service. Navigate to Configuration > Dynamic CI Groups linked to CMDB Group. Table: cmdb_group. Navigate to Configuration > CMDB Groups. Service Classification=Technical Service It is possible to have more than one Dynamic CI Group related to the TSO. Synched Fields The fields on the Technical Service Offering CI are synched to the CIs that are part of the CMDB Group only Support group [support_group]Change group [assignment_group]Managed by group [managed_by_group] Managed by [managed_by], which is in the default form layout, is not synched. Customers will need to add Managed by group [managed_by_group] to the form layout. CMDB Group CIs A CMDB Group can specify the CIs in 3 ways: Saved Queries [cmdb_group_contains_qb_query], links to a Query Builder saved query [qb_saved_query]. That will have it's own result table, that extends Query Builder Results [cmdb_qb_result_base], which is Table-Per-Partition.Encoded Query [cmdb_group_contains_encoded_query]. Simply a condition builder.CIs [cmdb_group_contains_ci]. 1 record per CI. CSDM Data Sync scheduled job /sysauto_script.do?sys_id=3903094e5362101061b7ddeeff7b12be Runs daily, at 03:00. (every 24 hours) Loops through recently created Managed By relationship records, where parent and child are both Technical Services, and then fires an event for each. The key bit of script is this: Line 30: grRel.addEncodedQuery('sys_created_on>javascript:gs.hoursAgo(25)'); limits the query to relationship records created the last 25 hours. This means you need to get all the CIs and CMDB Group created first, then create the relationship last, so that when the job runs everything is there. If there is a problem with scheduled job processing in the instance, or it is paused during an upgrade, some new relationship records may be missed. Solution: Run the scheduled script from the Scripts - Background page, commenting out the sys_created_on line, and depending on how many CIs are involved, limit the query to specific cmdb_rel_ci sys_ids. Line 32: grRel.addEncodedQuery('parent.sys_class_name=service_offering^child.sys_class_name=cmdb_ci_query_based_service'); The parent class must be service_offering, and child class cmdb_ci_query_based_service. Don't create a Technical Service [cmdb_ci_service_technical] by mistake. Line 34: if(util.isTechnicalService(grRel.getValue('parent')) && util.isTechnicalService(grRel.getValue('child'))) { This calls script include CSDMCMDBUtil.isTechnicalService, and the line:return (grTech.get(sysId) && grTech.getValue('service_classification') == 'Technical Service'); Both the Technical Service Offering and Dynamic CI Group must have Service Classification=Technical Service. If either is Business Service, Application Service, or some other value, then sync won't happen. Lines 35-45: Put the new field values from the service_offering record into a JSON object Line 46: gs.eventQueue('csdm.tso.modified', tso, JSON.stringify(oldValues), JSON.stringify(newValues), 'sn_csdm_tso_queue'); Fires an event named csdm.tso.modified, and finishes. The csdm.tso.modified event Name: csdm.tso.modifiedParm1: JSON object of oldValuesParm2: JSON object of newValuesTable/Instance: The parent TSO CIQueue: sn_csdm_tso_queue CSDMTSOEventProcessor job /sys_trigger.do?sys_id=936659370723011017b703767cd300f8 As the queue of these events is set to sn_csdm_tso_queue, the normal "Events Process 0" job is not going to process them. This thread/scheduler worker is what process the script action that does the CI updates. Processing these updates for thousands of CIs could be very long running, so a separate queue and events processing job is used. Known Problem PRB1578201/KB1120223 CSDMTSOEventProcessor missing in sys_trigger on some instances: group assignment attributes on Technical Service Offerings do not sync to group CIsFixed in San Diego Patch 5, San Diego Patch 5 The "Sync From TSO to CI" Script Action /sysevent_script_action.do?sys_id=54edf01b7302101061b79c0c6df6a739 For each CI, in each Dynamic CI Group related to the TSO, the CI will be updated with the 3 new values. If this runs, you will see this logged in syslog and app node localhost logs, to show the CI Groups are being updated, to re-query CMDB Query Builder and Encoded Queries:gs.log("Updating " + dcg.length + " 'Dynamic CI Group(s)' records."); If there are any CIs to update, you will also see:gs.log("Updating " + cisToUpdate.length + " CI records belonging to some 'Dynamic CI Group(s)'."); The updateRecords() function in CSDMCMDBUtil script include is used for the actual CI updates. updateMultiple() is used like any normal update, so Business rules, auditing, and other engines will run as part of this update. Known Problem PRB1650669/KB1293523 CSDM Data Sync scheduled job does work when a Managed By Group is not populated.