CTI processing business rule - create interaction record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 02:58 AM
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.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 12:44 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 12:47 AM
Okay, so far so good. Can you share the code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 02:25 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 03:21 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 04:38 AM
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.