CTI processing business rule - create interaction record

MJL_
Tera Contributor

Hi,

Im trying to build a functional requirement for our ServiceDesk. The requirement is that if they receive a call in our call center application a interaction gets created with the 'opened_for' and type field pre-filled. Im achieving this through the cti processing business rule and can get a new interaction to pop up pre filled in the agent workspace just fine its just not save yet. See line 32/33 in the screenshot.

Seems like a minor issue but lets say it isn't. Now the documentation on this says":

"sysparm_cti_rule=name where 'name' is the name of a function to be invoked for CTI processing rather than using the default script. The function must be defined in a sys_script entry marked client callable. If the function needs to insert, update, or delete any GlideRecord(s), it must call a separate non-client callable function to perform the update(s).

https://docs.servicenow.com/bundle/rome-platform-administration/page/integrate/incident/reference/r_ComputerTelephonyIntegration.html

But I cant get it to work, if tried using a single function script include (line 17/18), regular script include (line 23-25) and a function inside the global business rule itself (line 20/21) the global rule just doesn't seem to call the function. Even when it contains a simple gs.log there is nothing showing up in the log. As if the function just isn't being called.

Has anyone done this? What am i missing?

userID is not null and when i test the function in a fix script its working just fine and creates an interaction so nothing wrong there.

 find_real_file.png

13 REPLIES 13

The rule is running because the popup is showing when its a new interaction form that hasn't been saved. Its just when I want to create a record, return that sid to the business rule and show that record in the pop up its not working.

Okay, so far so good. Can you share the code?

sure:

var CompanyIMS = Class.create();
CompanyIMS.prototype = {
    initialize: function() {	
	},

    create: function(opened_for,opened_by,type) {

        var gr = new GlideRecord("interaction");
        gr.initialize();

        gr.opened_for = opened_for;
        gr.opened_by = opened_by;
        gr.type = type;
        var sid = gr.insert();
		
		return sid;

    },

    type: 'CompanyIMS'
};

 

Very simple but even if I just put a gs.log in the initialize nothing gets logged. Im calling this include from lines 24 / 25.

Calling this inlcude from a fix script works just fine, the interaction gets created and the sid is returned. Just not from the cti processing rule.

Strange, everything looks ok. And the Script Include is not client callable? Line 24 in the Business Rule, can you ctrl+click that to open the Script Include?

Yes I can click the script include in line 24 and it opens the one I posted. Im going to create a support case for this, see what they have to say. Looked it over with a SN partner and they also couldn't figure it out.

If I get an answer i'll post back here.