OOTB Relationship Types deleted and recreated <!-- .SOKMKBArticle div.margin { padding: 10px 40px 40px 30px; color: #283d40; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; } .SOKMKBArticle div.fed{ background-color: #f5f8fa; border: 1px solid; border-color: #bfbfbf; padding: 10px; } .SOKMKBArticle .FedRestricted{ background-color: #c00000; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle .CustRestricted{ background-color: #ff0000; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle .SNRestricted{ background-color: #ea700d; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle .SNConfidential{ background-color: #ffc000; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle .Public{ background-color: #00b050; color: #ffffff; padding: 10px; margin-top: 10px; text-align: center; font-size: 14pt; font-weight: bold; } .SOKMKBArticle table.tocTable { border: 1px solid; border-color: #f2f2f2; background-color: #f2f2f2; padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } .SOKMKBArticle table.noteTable { align: left; border: none; border-color: #81b5a1; background-color: #f2f2f2; width: 100%; border-spacing: 2; font-size: 11px; } .SOKMKBArticle table.internalTable { border-top: 1px solid; border-left: 1px solid; border-color: #81b5a1; width: 100%; border-spacing: 1px; } .SOKMKBArticle .sp td { border-bottom: 1px solid; border-right: 1px solid; border-color: #81b5a1; background-color: #ffffff; height: 20px; padding-top: .5em; padding-bottom: .5em; padding-left: .5em; padding-right: .5em; } .SOKMKBArticle .sphr td { border-right: 1px solid; border-bottom: 1px solid; border-color: #81b5a1; background-color: rgb(245, 245, 245); padding-top: .5em; padding-bottom: .5em; padding-left: .5em; padding-right: .5em; height: 20px; } .SOKMKBArticle .sh td { border-bottom: 1px solid; border-right: 1px solid; border-color: #81b5a1; background-color: #81b5a1; color: #ffffff; height: 20px; padding-top: .5em; padding-bottom: .5em; padding-left: .5em; padding-right: .5em; } .SOKMKBArticle th { padding-top: .5em; padding-bottom: .5em; padding-left: .5em; padding-right: .5em; border-bottom: 1px solid; border-right: 1px solid; border-color: #646464; background: #646464; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: white !important; height: 20px; } .SOKMKBArticle td { border-color: #646464; margin: 5px 5px 5px 5px; padding: 5px 5px 5px 5px; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; color: #283d40; } .SOKMKBArticle p { color: #283d40; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; } .SOKMKBArticle li { color: #283d40; font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; font-size: 10pt; line-height: 1.5; } .SOKMKBArticle pre { font-family: Courier New; } .SOKMKBArticle div { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; } .SOKMKBArticle hr { border-top-width: 1px; border-top-style: solid; border-top-color: #81b5a1; } .SOKMKBArticle a { color: #81b5a1; } .SOKMKBArticle a.two:link { padding: 15px 45px 15px 45px; margin-top: 20px; color: #ffffff; text-align: center; background-color: #1F8476; border: 1px solid; border-color: #1F8476; } .SOKMKBArticle a.two:visited { padding: 15px 45px 15px 45px; margin-top: 20px; color: #ffffff; text-align: center; background-color: #1F8476; border: 1px solid; border-color: #1F8476; } .SOKMKBArticle a.two:hover { color: #ffffff; background-color: #259b8a; } .SOKMKBArticle .button { padding: 15px 45px 15px 45px; margin-top: 20px; color: #ffffff; text-align: center; background-color: #1F8476; border: 1px solid; border-color: #1F8476; } .SOKMKBArticle .title { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #81b5a1; font-size: 30pt; } .SOKMKBArticle .hd1 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-size: 20pt; border-bottom: 1px solid; border-bottom-color: #81b5a1; text-decoration: none; } .SOKMKBArticle h1 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-size: 20pt; font-weight: normal; border-bottom: 1px solid; border-bottom-color: #81b5a1; text-decoration: none; } .SOKMKBArticle .hd2 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #68a1af; font-weight: bold; font-size: 16pt; text-decoration: none; } .SOKMKBArticle h2 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #68a1af; font-weight: bold; font-size: 16pt; font-weight: normal; text-decoration: none; } .SOKMKBArticle .hd3 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 14pt; text-decoration: none; } .SOKMKBArticle h3 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 14pt; text-decoration: none; } .SOKMKBArticle .hd4 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 12pt; text-decoration: none; } .SOKMKBArticle h4 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 12pt; text-decoration: none; } .SOKMKBArticle .hd5 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: bold; font-size: 10pt; text-decoration: bold; } .SOKMKBArticle h5 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: bold; font-size: 10pt; text-decoration: bold; } .SOKMKBArticle .hd6 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 10pt; text-decoration: underline; } .SOKMKBArticle h6 { font-family: Century Gothic, Verdana, Helvetica, Arial, sans-serif; color: #283d40; font-weight: normal; font-size: 10pt; text-decoration: underline; } .SOKMKBArticle details { font-size: 10pt; } .SOKMKBArticle details[open] summary ~ * { animation: sweep .5s; margin-top: 0; padding-top: 10px; } @keyframes sweep { 0% {opacity: 0; margin-top: -10px} 100% {opacity: 1; margin-top: 0px} } .SOKMKBArticle summary { cursor: pointer; outline: none; margin-bottom: 3px; } .SOKMKBArticle .summary { background-color: #81b5a1; font-size: 10px; color: white; cursor: pointer; padding: 5px; width: 100%; border: none; text-align: left; outline: none; vertical-align: top; } --> Get Well Playbook Base System Relationship Types Deleted and Recreated A guide for how to manage customized base system relationship types Table of Contents Summary Audience Problem Overview Executive Summary How this playbook can help you achieve your business goals How this playbook is structured Problem Analysis Upstream Causes Downstream Consequences Impact on Your Business Remediation Plays Summary Analysis Play Fix 1 of 3: Restore the Base System Relationship Types Fix 2 of 3: Update the CI Relationships to the correct Type Fix 3 of 3: Delete the Custom Relationship Type Data Governance Summary Goal of this Playbook The playbook addresses the following scenario: One of the relationship types included in the base system CMDB has been deleted. Someone has recreated (and customized) the relationship type. However, the recreated version isn't working. You need to restore the base system relationship types, import your customized settings to the base system versions, and delete the recreated (customized) versions. This playbook tells you how to do these tasks. Details about this playbook Author Emir EminovicDate 06/22/2020Addresses HSD # HSD0002253, HSD0008213Applicable ServiceNow Releases All ReleasesTime required Approximately 1 to 4 hours Audience Configuration Manager or Configuration Management teamServiceNow Admin Problem Overview To work properly, service maps use relationship types to establish connections between CIs. In many service maps, the system IDs (Sys_IDs) for the CIs are hardcoded in the relationship types. When a relationship type is deleted, and a new one is created with a different Sys_ID, the relationship types don't work and the service map connections fail. Executive Summary How this playbook can help you achieve your business goals Using the base system relationship types helps to ensure that product features function as intended. How is this playbook is structured This playbook guides you through five plays. The first play (an analysis play) lets you see if you have any customized relationship types, and if so, how many. The next three plays are fix plays. You need to complete all three in order. The first one restores the base system relationship types. The second one imports your customized changes to the base system relationship types so you can still use the customizations. The third one deletes the customized relationship types, as you no longer need them. The final play (a governance play) describes the processes you can use to prevent recreating and customizing the base system relationship types. Problem Analysis Upstream Causes Due to confusion, a new relationship type may get created instead of using one included in the base system of the CMDB. A new relationship type may get created to address custom requirements. Downstream Consequences Data Consequence Data will appear correct, but in reality, an invalid sys_id is referenced Operation Consequence Data will appear correct, but in reality, an invalid sys_id is referenced App Consequence Your base system applications and features may not work properly if the relationship types aren't configured correctly Impact on Your Business Lower MTTR Dependency Map views and Service Maps will suffer from malfunction Decrease Operational Visibility Poor visibility due to islands of Data on Dependency and service Maps Process Automation Queries that look up CIs based on OOB relationships for Reference lookups will fail Audit/Compliance Audit queries might fail when they depend on OOB values to be present Engagement Questions: Have you created any custom relationship types? Do you have a dedicated CMDB Architectural Review Process? How do you decide when to create a new CMDB Relationship Type? Have you deleted any relationship types included with the base system of the CMDB? Remediation Plays Summary Play Analysis What this play is about Lets you see if you have recreated any of the base system relationship types. These are considered custom relationship types. Required tasks Run the Analysis Play script to find the custom relationship types, if any Fix 1 of 3 - Restore missing Relationship Type What this play is about Tells you how to restore (reimport) the base system relationship types Required tasks Reimport the base system relationship types and then verify that this task completed successfully Fix 2 of 3 - Update Relationships to correct Relationship Type What this play is about Explains how to update your relationship types so that the correct types are used. Required tasks Run the Fix Script to reassign the relationship types and then verify that this task completed successfully. Fix 3 of 3 - Delete Custom Relationship Type What this play is about Lets you delete your custom relationship types. Required tasks Follow the steps to delete the custom relationship types and then verify that this task completed successfully. Data Governance What this play is about Includes guidelines and processes for managing relationship types. Required tasks Follow these guidelines and processes to prevent recreating base system relationship types. Analysis Play What this Play is about This play lets you see if you have recreated any of the base system relationship types. Any that you have recreated are considered custom versions and they may not work as intended. This play includes an Analysis Plays script that you can use to find these custom relationship types. Required tasks Option 1: Install CMDB and CSDM Data Foundations Dashboard from the ServiceNow App StoreNavigate to the CMDB Data Foundations Dashboard module in the left navigation menuSelect the Customizations tabSelect the Use of Custom Attributes line in the score card shows the current scoreSelect the Base System Relationship Types Deleted or Recreated report to view a list of base system relationships deleted or recreated. If you see a count of zero then this playbook is not applicable to you. Option 2: Run the QueryScript_OOBRelationshipsDeletedAndRecreated.xml as a Fix ScriptReview the results of the script. The results show the number of custom relationship types you have, if any. If the number is zero (0), you don't have any custom relationship types. You don't need to do anything else. You don't need to use this playbook.Otherwise, continue with each of the remaining plays in this playbook. Start with Fix Play: 1 of 3. Be sure to complete all three Fix Plays, When you have custom relationship types, output similar to the following appears Note: The number of custom relationship types is highlighted in purple. The number of CIs using this relationship type is in green. Before you continue Write down the Sys_ID, the parent descriptor, and the name of the relationship type. You will need this information throughout the rest of the playbook.Work on one relationship type (as shown in the results above) at a time.Repeat the tasks in this playbook for each relationship type listed in the script results. Fix Play: 1 of 3 – Restore the Base System Relationship Types What this Play is about This play tells you how to restore (reimport) the base system relationship types. Required tasks Navigate to the sys_update_xml.list tableApply the following filters: Type = CI Relationship TypeTarget name = Contains the parent descriptor of the relationshipFor example, to use the Feeds::Fed by as the target name, enter Feeds. Information similar to the following appears. Important: Make sure that both the DELETE and INSERT_OR_UPDATE actions are shown in the Action column. Select the original record (the one with the DELETE action) to see details about the record. Make sure that the XML payload references the correct Sys_ID in the Base Relationship Type list. The updateset names should also match. Click Show Related Record Related Link Ensure the XML payload references the correct Sys_ID (same as above step) Review the contents of the Deleted Data tab and the Deleted Files – References tab Click the Restore File button.Click OK, and then click Done.Navigate to the cmdb_rel_type.list table.Search for the parent descriptor that contains the parent descriptor of the relationship.You should now see 2 records in the CMDB_REL_TYPE table. Continue with Fix Play: 2 of 3. Fix Play: 2 of 3 – Update the CI Relationships to the correct Type What this Play is about This play tells you how to update your CI relationships so that the correct types are used. This play includes a Fix Script you can use to reassign the relationship types. Required tasks Open the FixScript_ReassignRelationsipType.xml and make the following changes Change the customRel variable on line 13 to the SYS_ID of the custom relationship (from step 2 of Analysis Play) Change the oobRel variable on line 15 the SYS_ID of the OOB Relationship (from step 3a of the Fix Play: 1 of 3) Sample setup Run the script as a Fix script and review the resultsThe total number of relationships to be updated should match the number you have previously recorded in step #4 of the Analysis play NOTE: If the numbers do not match, do this play again. You might also have to do the previous two plays again as well. Once the numbers match, go to step 4. Change the dryRun variable on line 17 of the Fix Script to falseRun the Fix Script again and review the results to confirm the update NOTE: You can rollback this transaction using the out of the box script rollback feature Change the dryRun variable on line 17 to trueRun the script one more time and review the results of the script. You should see results similar to the following (specifically, you should see 0 relationships found with the custom type). Proceed with Fix Play 3 of 3. Fix Play: 3 of 3 – Delete Custom Relationship Type What this Play is about This play lets you delete your custom relationship types. Important: Before you delete a custom relationship type, make sure that it isn't used anywhere else, such as in forms, scripts, or reports. Required tasks Navigate to cmdb_rel_type.listSearch for a name that starts with the parent descriptor of the relationship. For example, to find "Feeds::Fed by" search for Feeds Open the recordMake sure that the Sys_ID is the same one you noted in step 3 of the Analysis Play. This is the custom relationship type you want to deleteClick the Delete Button and confirm the deletionNavigate to the cmdb_rel_type.list tableSearch for a name that starts with the parent descriptor of the relationship. For example, to find "Feeds::Fed by" search for FeedsSince the relationship type is now deleted, there should be only one search result Next Step: If you have other custom relationship types, return to step 3a of the Analysis Play, and repeat each of the Fix Plays. Otherwise, continue with the Data Governance Play. Data Governance What this Play is about This play includes guidelines and processes for managing relationship types. These guidelines and processes help to prevent recreating base system relationship types. Note the following points: Use the base system relationship types as much as possible.Before you create a custom relationship type, see if one already exists in another module. If it does, consider using that relationship type. Required tasks Periodically complete the tasks in the Analysis Play.This helps you see if any base system relationship types have been recreated and customized. If you don't already have an approval process for creating relationship types, consider establishing one. Make sure the process is followed. Congratulations You have completed this Get Well Playbook.