This customization adds a logo next to a field that is mapped to an external system. It is written for Incident Management, but you could alter the script to use for other ServiceNow applications.
How it works for example:
If you have ServiceNow integrated to HP Service Manager to exchange incident information, this customization will add the HP logo next to fields you have mapped.
Screenshots
Salesforce Integration (Click to view)
HP Integration (Click to view)
Altris Integration (Click to view)
Step 1: Upload Images
1. Download logos that you are using for integrations to ServiceNow
2. Use an image editor to scale the image to 25px x 25px or less
3. In ServiceNow, in the left navigator, click System Definition > Upload File
4. Upload file. Note the filename changes to lower case.
Step 2: Insert Contact Types
If you using this script with Incident with Incident Management, add some contact types to trigger the integration
1. Open Incident Form
2. Right click Contact Type field
3. Personalize Choices
4. Enter new item
5. Click Save
Step 3: Add Client Script
Add Integration Decorations client script that displays the images in the label for Incident Management. You can change this script for how you would like it work for your integration.
Client Script: Integration Decorations
Global: true Type: onChange Table: Incident [incident] Field Name: Contact Type Script: function onChange(control, oldValue, newValue, isLoading) { var mappedFields = ''; var allMappedFields = 'cmdb_ci,caller_id,priority,subcategory,short_description,comments';//all Mapped fields used by integrations, used to clear labels and images on field change if (newValue == 'Salesforce') { mappedFields = 'cmdb_ci,caller_id,priority,subcategory,short_description,comments'; changeIntegrationLabels(allMappedFields, '', ''); //clear labels changeIntegrationLabels(mappedFields, 'blue', 'salesforce1.png', newValue); //set labels } else if (newValue == 'HP') { mappedFields = 'cmdb_ci,caller_id,priority,subcategory,short_description,comments'; changeIntegrationLabels(allMappedFields, '', ''); //clear labels changeIntegrationLabels(mappedFields, 'blue', 'hp.png', newValue); //set labels } else if (newValue == 'Altris') { mappedFields = 'cmdb_ci,caller_id,subcategory,short_description,comments'; changeIntegrationLabels(allMappedFields, '', ''); //clear labels changeIntegrationLabels(mappedFields, 'blue', 'altris.png', newValue); //set labels } else if (newValue == 'IBM') { mappedFields = 'cmdb_ci,caller_id,subcategory,short_description,comments'; changeIntegrationLabels(allMappedFields, '', ''); //clear labels changeIntegrationLabels(mappedFields, 'blue', 'ibm.png', newValue); //set labels } else { changeIntegrationLabels(allMappedFields, '', ''); } } function changeIntegrationLabels(fieldNames, color, labelImage, integrationSystem) { var fa = fieldNames.split(','); for (i = 0; i < fa.length; i++) { //document.getElementById('label.incident.' + fa[i]).style.color=color; document.getElementById('label.incident.' + fa[i]).style.backgroundImage = 'url('+labelImage+')'; document.getElementById('label.incident.' + fa[i]).style.backgroundRepeat = "no-repeat"; document.getElementById('label.incident.' + fa[i]).style.backgroundPosition = "95% 55%"; var title = document.getElementById('label.incident.' + fa[i]).title; if (title.indexOf(integrationSystem) < 0) document.getElementById('label.incident.' + fa[i]).title = title + ' (Mapped to '+integrationSystem+')'; } }