Calling script include from record producer script.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 08:11 AM
Any help is appreciated. I am trying to call a script include from a record producer. The record producer scrip stops at '
var ga = new GlideAjax('IncidentAssignmentGroup');' it does not call the script include. Any thoughts? Thanks.
Record Producer Script:
// Set initial values
current.setValue('impact', '3');
current.setValue('urgency', '3');
current.setValue('contact_type', 'self-service');
// Set short description
var shortDescription = producer.description.toString().substring(0, 100);
current.short_description = shortDescription;
// Get the values of the variables
var category = producer.getValue('category');
var location = producer.getValue('location_new');
var business_service = producer.getValue('business_service');
// Create a GlideAjax object and pass the script include name
var ga = new GlideAjax('IncidentAssignmentGroup');
ga.addParam('sysparm_name', 'getAssignmentGroup');
ga.addParam('sysparm_category', category);
ga.addParam('sysparm_location', location);
ga.addParam('sysparm_service', business_service);
ga.getXMLAnswer(function(response) {
var assignmentgroup = response;
producer.setValue('assignment_group', assignmentgroup);
});
// Add info message
gs.addInfoMessage("Thank you! Your incident has been submitted.");
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 08:20 AM
I assume IncidentAssignmentGroup is the name of a custom script include and getAssignmentGroup is the name of a function within that script include? Is there a reason you need to use a script include rather than just doing the search directly in the Record Producer?
And why are you setting the producer's value to the returned value and not the current record's value? I think that line should be
current.setValue('assignment_group', assignmentgroup);