Populate RITM assignment group in a catalog variable using glideajax and script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 03:42 AM
When we order a catalog item there is an assignment group showed in RITM. How to populate that assignment group value in catalog item variable(field) using glideajax and script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 03:50 AM
you want to populate field on RITM or variable on catalog item?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 04:02 AM
i want to populate field which is present on Ritm only but is a field of catalog item like shown in image.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 03:52 AM
// MyScriptInclude.js
var MyScriptInclude = Class.create();
MyScriptInclude.prototype = {
initialize: function () { },
getAssignmentGroup: function (ritmSysID) {
var assignmentGroup = '';
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(ritmSysID)) {
assignmentGroup = ritmGR.assignment_group.getDisplayValue();
}
return assignmentGroup;
},
type: 'MyScriptInclude'
};
// Client Script
function populateAssignmentGroupValue() {
var ritmSysID = g_form.getValue('request_item');
var ga = new GlideAjax('MyScriptInclude');
ga.addParam('sysparm_name', 'getAssignmentGroup');
ga.addParam('sysparm_ritmSysID', ritmSysID);
ga.getXML(populateAssignmentGroupCallback);
}
function populateAssignmentGroupCallback(response) {
if (response && response.responseXML) {
var answer = response.responseXML.documentElement.getAttribute('answer');
if (answer) {
g_form.setValue('assignment_group_variable', answer);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 03:56 AM - edited ‎09-12-2023 04:06 AM
Hey @Kamal Jangid :
What are you trying to achieve here The RITM will be routed to the appropriate fulfillment group when the request is submitted This is either achieved via an Assignment rule or on Workflow or flow designer
If are expecting to show which group request needs to be routed then you need to have a reference qualifier advanced or simple on the group table reference field on the catalog field.
Mark this as Helpful / Accept the Solution if this clears your issue