Record Producer Group Routing Enhancement

purdue
Kilo Sage

Hello,

We have a requirement to add RP assignment group lookup through a system property when the user selects release = HyperCare EMEA.  Currently the group assignment is routing is going through the code below.  I need to skip these if HyperCare is selected.  I need to pass in the application name into rp and return the group from system property.  For example if user selects application WBD SAP Fixed Assets/IO: Production then return group ESS WBD S4 Deloitte Hypercare FA/IO to rp assignment group if not then use the gliderecord below.

 

var supp_grp = new GlideRecord('u_support_group_routing');
supp_grp.addQuery('u_active', true);
supp_grp.addQuery('u_configuration_item', producer.select_application);
supp_grp.addQuery('u_record_producer', 'CONTAINS', cat_item.sys_id);
supp_grp.query();
if (supp_grp.next()) {
if (supp_grp.getValue('u_support_group')) {
supp_grpid = supp_grp.getValue('u_support_group');
}
}
current.assignment_group = supp_grpid;
 
Any assistance is appreciated.
Thanks,
Chad
1 ACCEPTED SOLUTION

Hello,

 

Working with our other developers we were able to come up a solution.   Here is the final solution in case someone has the same requirement.

Record Producer

var jsonData = JSON.parse(gs.getProperty("producer.sap_s4_support.groups")); //name of your property

if(!gs.nil(jsonData[release])){
group_name = jsonData[release][app];
}

if (!group_name)
{
var supp_grpid = gs.getProperty('incident.default.group'); //Global Service Desk
var supp_grp = new GlideRecord('u_support_group_routing');
supp_grp.addQuery('u_active', true);
supp_grp.addQuery('u_configuration_item', producer.select_application);
supp_grp.addQuery('u_record_producer', 'CONTAINS', cat_item.sys_id);
supp_grp.query();
if (supp_grp.next()) {
if (supp_grp.getValue('u_support_group')) {
supp_grpid = supp_grp.getValue('u_support_group');
}
}
current.assignment_group = supp_grpid;
}else{
current.assignment_group = group_name;
}
System Property
application id : group
{
"Hypercare EMEA": {
"a672baab933a82941243b47d1dba10c6": "773d18ba833a0e54cd1478226daad342 ",
"523376e3937a82941243b47d1dba1056": "9adcd87ec3b20a108dc3f8aa050131b8",
"34e376af937a82941243b47d1dba101d": "f2ae5cba93ba4a54c270b1266aba1065",
"488d5facc34346109a6a1ce0e00131e9": "f2ae5cba93ba4a54c270b1266aba1065",
"e5bdf43e33728254296947434d5c7b8d": "c6d0986e933a0654c270b1266aba108c",
"ead4b6ab93ba82941243b47d1dba10b3": "c6d0986e933a0654c270b1266aba108c",
"fcc5bae793fa82941243b47d1dba1006": "a21f94bac3f20a108dc3f8aa05013118",
"137dfcba33728254296947434d5c7bb3": "01ffd0ba333ec61497b552e36d5c7b83",
"e5e6d69393be0a5472ebf8a56aba108b": "bea2e87a93be06541243b47d1dba1013",
"ebf63667933e82941243b47d1dba104a": "e26f1cfac3f20a108dc3f8aa050131eb",
"ce487ea3937e82941243b47d1dba1086": "e26f1cfac3f20a108dc3f8aa050131eb",
"900620ea930e7910860bb6a74dba10c7": "f2bbe9ba833a8e54cd1478226daad392",
"d052fba58347c650cd1478226daad3f8": "f8c3d9301b98b1d0783f43b1b24bcbb8"
}
}

View solution in original post

8 REPLIES 8

purdue
Kilo Sage

Hello,

I tried excluding the code above with 

if (producer.release.value != '4813273d1b086210f27a43b1b24bcb93'){  the sys_id of the release field record HyperCare EMEA but it is not working.    Note this is pulled from a lookup select box.  see below
variable.png

purdue
Kilo Sage

I thought name value pairs would work but cannot get it working.  I put 

var taskDetail = JSON.parse(gs.getProperty('SAP S4 Release Groups'));
var group_sys_id = taskDetail[g_form.getValue('select_application')];
current.assignment_group = group_sys_id;
With property 
 
{ {
"a672baab933a82941243b47d1dba10c6" :"773d18ba833a0e54cd1478226daad342",
}]

Medi C
Giga Sage

Hi @purdue,

 

is cat_item a variable on your catalog item? If so, then you are missing "producer" in:

supp_grp.addQuery('u_record_producer', 'CONTAINS', producer.cat_item);

 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

Hello,

No it is not.  I need to override this functionality when release = HyperCare EMEA and producer.select_application contains one of 12 applications.  For example

User selects Release is HyperCare EMEA AND Application is one of 12 instead of using GlideRecord to support group routing lookup the property and application selected then return the group and set it when the incident is created.  Thanks