The CreatorCon Call for Content is officially open! Get started here.

Extension Point --- How it Work ?

Vincenzo
Tera Contributor

Hi all,

I have the requirement to extend the mapping of fields copied from case to an Incident when I creating it from the case.

So I have tried to edit the extension point "CSMIncidentIntegrations" thinking that it will be used as an extension of the Script include, but it not work...

...could someone help me to understand how the extension point work?

 

My idea:

The UI Action trigger:

new sn_cs_sm.ServiceManagementIncidentUtils().createIncidentFromCase(current, action);

The "ServiceManagementIncidentUtils" contains "getExtensions" :

createIncidentFromCase: function(caseGr, uiActionHandler) {
	var incGr = new GlideRecord("incident");
	var ep = new GlideScriptedExtensionPoint().getExtensions(ServiceManagementIntegrationConstants.CASE_INC_EXTENSION_POINT);
	//If there is any other new extension instance other than the OOB one, concat them together
	//The extension instance with higher order number would overwrite the one with lower order number
	for(var i = 0; i < ep.length; i ++){
		var point = ep[i];
		point.copyFieldsFromCaseToIncident(incGr, caseGr);
	}
	
	var incSysId = incGr.insert();
	caseGr.incident = incSysId;
	caseGr.update();
	gs.addInfoMessage(gs.getMessage("Incident {0} created", incGr.number));
	uiActionHandler.openGlideRecord(incGr);
	uiActionHandler.setReturnURL(caseGr);
},

in the Extension Point of "CSMIncidentIntegrations", in function "copyFieldsFromCaseToIncident" I have added:

	copyFieldsFromCaseToIncident: function(incGr, caseGr) {		
		incGr.description = caseGr.description;
    },

But the system doesn't map the field...

..I have tried also to add gs.info ('------GO------');

But I haven't found anything in the LOG...

 

 

...could someone help me to understand how the extension point work?

Best Regards

Vincenzo\

1 ACCEPTED SOLUTION

Vincenzo
Tera Contributor

Hi,

I have found why my Extension Point are not triggered by the system...

...the problem was that for active on the system the Extension Point, you need to click the link "Create Impementation"

 

find_real_file.png

 

Now it work correctly.

 

Best Regards

Vincenzo

View solution in original post

9 REPLIES 9

Vincenzo
Tera Contributor

Hi Steven,

The second one, you need first to configure the extension point with your new logic (script), and after you need to click "create implementation".

by

Vincenzo

Kalyani14
Kilo Contributor

Hi @Vincenzo

 
Can you please be kind to explain the procedure of how u have made changes to the script include and the extension script, for me all the script related to the integrations shows read only. i have to add certain fields which i need to map to incident while the case creation, but all the related scripts read only protection policy, how do i edit it?

Hello

jnfjn
Tera Contributor

How to edit,  "CSMIncidentIntegrations", its protection policy is read-only

 

Sondre
Tera Contributor

Hi, you must locate the script include by navigating to "scripted extension points". Find the relevant extension point, open it. Here you will see the "create implementation" related link.