- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 09:28 AM
Hi All,
the client asked me to implement a UI action to suggest an assignment group to the agent after changing some fields of the case (Business Service and other custom fields).
Is there a way to execute on-demand assignment rules, which I have defined to assign the case when it is created, and show the result to the agent who can decide whether or not to accept the suggestion?
I don't want the assignment group of the case always be recalculated on update.
Thanks,
Piero.
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2020 03:42 AM
I've found the solution using GlideFilter.checkRecord() and GlideScopedEvaluator().evaluateScript() functions.
checkRecord allows me to find the assignment rule that match with new values of my record.
evaluateScript returns me the sys_id of the calculated group.
Thanks all for the support,
Piero
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2020 03:42 AM
I've found the solution using GlideFilter.checkRecord() and GlideScopedEvaluator().evaluateScript() functions.
checkRecord allows me to find the assignment rule that match with new values of my record.
evaluateScript returns me the sys_id of the calculated group.
Thanks all for the support,
Piero
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2021 02:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2021 03:53 AM
Hi Shailendra,
this is the code of the Script Incude
var evaluator = new GlideScopedEvaluator();
var ar = new GlideRecord('sysrule_assignment');
ar.addQuery('table', cs.sys_class_name);
ar.orderBy('order');
ar.addActiveQuery();
ar.query();
var matched = false;
while (ar.next() && !matched) {
matched = GlideFilter.checkRecord(cs, ar.condition);
if (matched)
break;
}
var obj = {};
if (ar.group != "") {
obj.name = ar.group.name.toString();
obj.id = ar.group.toString();
} else {
var vars = {
'current': cs
};
var group = new GlideRecord('sys_user_group');
group.get(evaluator.evaluateScript(ar, 'script', vars));
obj.name = group.name.toString();
obj.id = group.sys_id.toString();
}
return JSON.stringify(obj);
cs variable is a Case record (sn_customerservice_case)
Hope this is helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2024 01:19 AM
hi there. may i know exactly where did you apply this script? i've been testing it on BR but to no avail