- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday - last edited Monday
I need to exclude resolved incidents in "Upcoming" in SOW so that we don't see any resolved incidents. OOB it's showing all active incidents.
I go to:
All -> Service Operations Workspace Admin Center -> Configurations
and click "Configure" on "Upcoming tasks"
I added this code where I added IGNORE_STATUS:
var SOWUpcoming = Class.create();
SOWUpcoming.prototype = Object.extendsObject(sn_sow_inc.SOWUpcomingSNC, {
IGNORE_STATUS: "state!=6", //is not resolved
_getIncidentWithSLAAtRisk: function() {
var encodedQueryToday = [
this.ACTIVE_RECORD, this.IGNORE_STATUS, this.ASSIGNED_TO_ME,
"JOINincident.sys_id=task_sla.task!" + this._getTodayDateQuery("planned_end_time"),
"JOINincident.sys_id=task_sla.task!has_breached=false"
].join("^");
var encodedQueryTomorrow = [
this.ACTIVE_RECORD, this.IGNORE_STATUS, this.ASSIGNED_TO_ME,
"JOINincident.sys_id=task_sla.task!" + this._getTomorrowDateQuery("planned_end_time")
].join("^");
var todayValue = this._getTableCount(this.TABLE.INCIDENT, encodedQueryToday);
var tomorrowValue = this._getTableCount(this.TABLE.INCIDENT, encodedQueryTomorrow);
this._addToTotal(todayValue, tomorrowValue);
var result = {
"label": {
"value": gs.getMessage("incident with SLA at risk"),
"plural": gs.getMessage("incidents with SLA at risk"),
},
"title": {
"value": gs.getMessage("Incident"),
"plural": gs.getMessage("Incidents"),
},
"today": { "value": todayValue },
"tomorrow": { "value": tomorrowValue }
};
gs.info("heju encodedQueryToday:");
if (todayValue === 1)
result.today.sysId = this._getRecordSysId(this.TABLE.INCIDENT, encodedQueryToday);
else
result.today.encodedQuery = encodedQueryToday;
if (tomorrowValue === 1)
result.tomorrow.sysId = this._getRecordSysId(this.TABLE.INCIDENT, encodedQueryTomorrow);
else
result.tomorrow.encodedQuery = encodedQueryTomorrow;
return result;
},
type: 'SOWUpcoming'
});
Saved it and hoped for the best, but it's not excluding resolved incidents.
Anyone with an idea? I've tried google and Copilot without success.
I have a gs.info() in the code, but it's not triggering. What is wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
