Issue
When cloning from production to non-production instances, preserving Service Portal branding requires identifying the tables and records to preserve, and then creating data preservers on the source instance.
Release
All supported releases
Resolution
1. Identify the table and records in the instance that you need to preserve.
- For example, in the HTML template field in a widget record, you may want to preserve the text warning, PLEASE NOTE THAT THIS IS NOT PRODUCTION.
- Because this widget may not exist in the source instance, you also need to preserve the sp_instance table.
2. For help finding where an object originates, run the following script in the Chrome Developer Tools console or create a task for CS-User Experience.
// BEGIN SCRIPT
$("div [widget='widget']").css("border", "1px solid red").css("padding-top", "20px").css("position", "relative").each(function(i){
var scope = $(this).scope();
var widget = scope.widget;
var elem = $("<div style='position: absolute; top: 1px; left: 1px'><a target='_blank' href='/$sp.do?id=widget_editor&sys_id="+ widget.sys_id+"'> "+ widget.name +"</a> </div>");
var printScope = $("<a href='javascript:void(0);'>Print scope</a>").on('click', function(){ console.info(scope); });
elem.append(printScope);
$(this).append(elem);
});
// END SCRIPT
The result outlines all the widgets on the page and gives you a clickable link to open each widget.
Example
Create data preservers for the widget table.
- Log in to the target instance.
- In the filter navigator, enter sp_widget.list
- Filter where Name = Not Production Warning
- Add the Body HTML template column to your filtered view, and verify that the entry shows: PLEASE NOTE THAT THIS IS NOT PRODUCTION
- Confirm that this entry is correct.
Preserve the table and records on the source instance
This is necessary so that the target settings are not overwritten by clones.
- Log in to the source instance.
- Go to System Clone > Preserve Data
- Create a new clone preserver:
Name: Widget
Theme: Check
Table: Widget [sp_widget]
Where Display Name = Not Production Warning
Create a data preserver for the sp_instance table if the widget does not exist in the source
The instance record is what ties the not production warning widget to the actual container record that is on the Service Portal page.
- Log in to the source instance.
- Go to System Clone > Preserve Data
- Create a new clone preserver:
Name: Instance
Theme: Check
Table: Widget [sp_instance]
To test the data preserver, schedule a clone.