Agent Chat Queues
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2024 10:11 AM
Hi
Can someone help me in setting up queues based on the payroll country vale from HR profile table. Have written a script below, please let me know if I am missing at something.
(function executeCondition(/* glide record */ current) {
if ('interaction_json_blob' != current.context_table || !current.context_document) return false;
var grBlob = new GlideRecord('interaction_json_blob');
if (grBlob.get(current.context_document)) {
try {
var value = JSON.parse(grBlob.getValue('value'));
var userName = value['opened_for'];
var hrProfile = new GlideRecord('sn_hr_core_profile');
hrProfile.addQuery('name', userName);
hrProfile.query();
if (hrProfile.next()) {
var hrPayrollCountry = hrProfile.getValue('u_payroll_country');
if (hrPayrollCountry.toUpperCase() === 'INDIA') {
return true;
}
}
} catch (e) {
return false;
}
}
return false;
})(current);
0 REPLIES 0