How to capture the value of caller's department
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 03:48 AM
Hi,
I have this script include and im trying to get the callers's department but i see the system logs that im not getting anything. I tried to type inc.caller_id.department but it didnt work as well. How can I capture the reference field department from the caller id on incident table?
var OperUtil = Class.create();
OperUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isService: function() {
var inc = new GlideRecord("incident");
inc.addQuery('active=true');
inc.query();
while (inc.next()) {
var gdt = new GlideDateTime(inc.sys_created_on);
var date = gdt.getDate();
gs.log('inc dept: '+ inc.caller_id.department.getDisplayValue());
var oper = new GlideRecord('u_operational_activity');
oper.addEncodedQuery('u_departments=' + inc.caller_id.department + '^u_from_date<=' + date + '^u_to_date>=' + date);
oper.query();
return oper.hasNext();
}
},
type: 'OperUtil'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 04:59 AM
@Gunjan Kiratkar I have the field Operational impact on the incident table. I need to make this field mandatory if these conditions are met:
1) the department of the caller that created the incident is equal to the department on u_opertioanl_activity table.
AND
2) on the u_operational_activity table we have two fields: From_Date and To_Date. The sys_created_on field from the incident table needs to be between these dates.
From Date <= sys_created_on =< To_Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2023 05:08 AM
Hi @Alon Grod ,
Please close this thread by marking appropriate response as correct, as you might get the log as expected and Open new thread for above issue.