To ensure that the data being shared out of Azure DevOps and into ServiceNow (inbound data) is being mapped correctly when arriving at your ServiceNow instance, you will next need to add and update some of the scripts in the transform maps under the PSP Common Transform Maps module. ServiceNow transform maps handle the format of data being shared into a ServiceNow instance. Making changes to the transform map scripts will allow data to be properly shared out of Azure DevOps and then be mapped correctly to the relevant fields in ServiceNow.


Procedure

To add and edit the transform map scripts for Azure DevOps, follow these steps:


Access the transform map

Log into your ServiceNow instance and navigate to Perspectium Common Documents > PSP Common Transform Maps or simply type and select Transform Maps in the Filter Navigator on the upper left-hand side of the screen. Then, search for and then click into the transform map you are integrating.

TableTransform Map
Incident

PSP Common Incident to Incident

ChangePSP Common Change to Change

Add field maps 

Scroll down to the list of Field Maps and search for and then click into assigned_to in the Target field

Check the Use source script checkbox, then add the following in the Source script:

answer = (function transformEntry(source) {
	if (source.u_assigned_to_email.indexOf('<') == -1)
		return "";
	var startIndex = source.u_assigned_to_email.indexOf('<') + 1;
	var endIndex = source.u_assigned_to_email.indexOf('>');
	var email = source.u_assigned_to_email.substring(startIndex, endIndex);
	var sgr = new GlideRecord('sys_user');
	sgr.addNotNullQuery('email');
	sgr.addQuery('email', email);
	sgr.query();
	if (sgr.next()) {
		return sgr.sys_id;
	}
	return "";

})(source);

Click Update to save your changes.