Resolution shaper data source

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2019 08:53 AM
Does anyone know where the data is stored that the timeline resolution shaper users on the case form in Customer Service? I was thinking it was using metrics, but there do not appear to be any metrics defined for Customer Service by default. Mainly about the time when state is changed. Yes I can create a metric around this, but if the data already exists I figured why duplicate it.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2019 01:46 PM
I took a look into this and it quite a lot into the black box. You can find the UI Macro which is using the "ResolutionShaper" API which isn't visible in the script include. But it exits within the script that is included into the UI Macro with this:
<g:requires name="com.sn_resolutionshaper/js_includes_resolutionshaper.js" includes="true" />
If you load a page with the resolution shaper, you can get to this code through the browser console like this:
But just scanning through the code real quick and looking after tables within ServiceNow. Since it's only handling states it can actually use a Baseline metric like this:
But otherwise I guessing they are pulling data from sys_audit, which I hope is wrong since that can end up as a major performance issue. But since you can configure it to be usable on other tables that the baseline ones as long as it's tasks, I can't see how it works with tables that doesn't have a Baseline metric to use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2019 12:18 AM
Im trying to change they way the Resolution shaper works so that it tracks on Assignment group instead of state.
But i feel that im running into a wall.
So far i have figured out:
The scripts/com.sn_resolutionshaper/js_includes_resolutionshaper.jsx contains:
var ACTIVITY_HISTORY_PROCESSOR = "angular.do";
var ACTIVITY_HISTORY_API = "list_history";
var taskSysId = 'b3cf63bddb90b700b182793ebf9619a1'; //This i have set myself
var glideAjax = new GlideAjax('', ACTIVITY_HISTORY_PROCESSOR);
glideAjax.addParam('sysparm_type', ACTIVITY_HISTORY_API);
glideAjax.addParam('table', 'task');
glideAjax.addParam('action', "get_new_entries");
glideAjax.addParam('sysparm_silent_request', "true");
glideAjax.addParam('sysparm_auto_request', "true");
glideAjax.addParam('sys_id', taskSysId);
glideAjax.getXML(function (data) {
console.log(data);//My own output
copyToClipboard(data.responseText); //My own output for analysis
});
angular.do is a processor in the JAVA layer which indicate that this CANNOT be edited 😞
In my test incident my responseText is:
{
"display_value": "Task",
"entries": [{
"display_value": "INC0011439",
"short_description": "test",
"is_email": false,
"user_image": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"label": "Incident",
"document_id": "b3cf63bddb90b700b182793ebf9619a1",
"sys_created_on_adjusted": "21-03-2019 08:00:21",
"entries": {
"journal": [{
"sys_id": "2d5bc486db14b700b182793ebf961915",
"sanitized_old_value": "",
"field_label": "Additional comments",
"is_truncated": false,
"change_type": "JOURNAL",
"old_value": "",
"field_type": "journal_input",
"new_value": "test test",
"sanitized_new_value": "test test",
"field_name": "comments"
}],
"custom": [],
"changes": [{
"sys_id": "6d5bc486db14b700b182793ebf961915",
"sanitized_old_value": "In Progress",
"field_label": "State",
"is_truncated": false,
"change_type": "AUDIT",
"old_value": "In Progress",
"field_type": "integer",
"new_value": "On Hold",
"sanitized_new_value": "On Hold",
"field_name": "state"
}]
},
"writable_journal_fields": ["comments", "work_notes"],
"user_id": "6816f79cc0a8016401c5a33be04be441",
"sys_created_on": "2019-03-21 07:00:21",
"sys_timestamp": 1553151621000,
"sys_created_by": "System Administrator"
}, {
"display_value": "INC0011439",
"short_description": "test",
"is_email": false,
"user_image": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"label": "Incident",
"document_id": "b3cf63bddb90b700b182793ebf9619a1",
"sys_created_on_adjusted": "21-03-2019 07:43:39",
"entries": {
"journal": [{
"sys_id": "3887884edbd0b700b182793ebf961900",
"sanitized_old_value": "",
"field_label": "Additional comments",
"is_truncated": false,
"change_type": "JOURNAL",
"old_value": "",
"field_type": "journal_input",
"new_value": "this is a new comment",
"sanitized_new_value": "this is a new comment",
"field_name": "comments"
}],
"custom": [],
"changes": []
},
"writable_journal_fields": ["comments", "work_notes"],
"user_id": "6816f79cc0a8016401c5a33be04be441",
"sys_created_on": "2019-03-21 06:43:39",
"sys_timestamp": 1553150619000,
"sys_created_by": "System Administrator"
}, {
"display_value": "INC0011439",
"short_description": "test",
"is_email": false,
"user_image": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"label": "Incident",
"document_id": "b3cf63bddb90b700b182793ebf9619a1",
"sys_created_on_adjusted": "21-03-2019 06:28:20",
"entries": {
"journal": [],
"custom": [],
"changes": [{
"sys_id": "6946bff1dbd0b700b182793ebf96197d",
"sanitized_old_value": "On Hold",
"field_label": "State",
"is_truncated": false,
"change_type": "AUDIT",
"old_value": "On Hold",
"field_type": "integer",
"new_value": "In Progress",
"sanitized_new_value": "In Progress",
"field_name": "state"
}]
},
"writable_journal_fields": ["comments", "work_notes"],
"user_id": "6816f79cc0a8016401c5a33be04be441",
"sys_created_on": "2019-03-21 05:28:20",
"sys_timestamp": 1553146100000,
"sys_created_by": "System Administrator"
}, {
"display_value": "INC0011439",
"short_description": "test",
"is_email": false,
"user_image": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"label": "Incident",
"document_id": "b3cf63bddb90b700b182793ebf9619a1",
"sys_created_on_adjusted": "21-03-2019 06:01:21",
"entries": {
"journal": [{
"sys_id": "46103b7ddb90b700b182793ebf9619da",
"sanitized_old_value": "",
"field_label": "Additional comments",
"is_truncated": false,
"change_type": "JOURNAL",
"old_value": "",
"field_type": "journal_input",
"new_value": "wefewf",
"sanitized_new_value": "wefewf",
"field_name": "comments"
}, {
"sys_id": "42103b7ddb90b700b182793ebf9619da",
"sanitized_old_value": "",
"field_label": "Work notes",
"is_truncated": false,
"change_type": "JOURNAL",
"old_value": "",
"field_type": "journal_input",
"new_value": "wwfe",
"sanitized_new_value": "wwfe",
"field_name": "work_notes"
}],
"custom": [],
"changes": [{
"sys_id": "82103b7ddb90b700b182793ebf9619da",
"sanitized_old_value": "New",
"field_label": "State",
"is_truncated": false,
"change_type": "AUDIT",
"old_value": "New",
"field_type": "integer",
"new_value": "On Hold",
"sanitized_new_value": "On Hold",
"field_name": "state"
}]
},
"writable_journal_fields": ["comments", "work_notes"],
"user_id": "6816f79cc0a8016401c5a33be04be441",
"sys_created_on": "2019-03-21 05:01:21",
"sys_timestamp": 1553144481000,
"sys_created_by": "System Administrator"
}, {
"display_value": "INC0011439",
"short_description": "test",
"is_email": false,
"user_image": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"label": "Incident",
"document_id": "b3cf63bddb90b700b182793ebf9619a1",
"sys_created_on_adjusted": "21-03-2019 06:00:55",
"entries": {
"journal": [{
"sys_id": "f3ff6fbddb90b700b182793ebf961988",
"sanitized_old_value": "",
"field_label": "Additional comments",
"is_truncated": false,
"change_type": "JOURNAL",
"old_value": "",
"field_type": "journal_input",
"new_value": "wfewef",
"sanitized_new_value": "wfewef",
"field_name": "comments"
}],
"custom": [],
"changes": []
},
"writable_journal_fields": ["comments", "work_notes"],
"user_id": "6816f79cc0a8016401c5a33be04be441",
"sys_created_on": "2019-03-21 05:00:55",
"sys_timestamp": 1553144455000,
"sys_created_by": "System Administrator"
}, {
"display_value": "INC0011439",
"short_description": "test",
"is_email": false,
"user_image": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"label": "Incident",
"document_id": "b3cf63bddb90b700b182793ebf9619a1",
"sys_created_on_adjusted": "21-03-2019 06:00:37",
"entries": {
"journal": [{
"sys_id": "dbefe77ddb90b700b182793ebf961974",
"sanitized_old_value": "",
"field_label": "Additional comments",
"is_truncated": false,
"change_type": "JOURNAL",
"old_value": "",
"field_type": "journal_input",
"new_value": "wef",
"sanitized_new_value": "wef",
"field_name": "comments"
}],
"custom": [],
"changes": []
},
"writable_journal_fields": ["comments", "work_notes"],
"user_id": "6816f79cc0a8016401c5a33be04be441",
"sys_created_on": "2019-03-21 05:00:37",
"sys_timestamp": 1553144437000,
"sys_created_by": "System Administrator"
}, {
"display_value": "INC0011439",
"short_description": "test",
"is_email": false,
"user_image": "c148e1d13741310042106710ce41f149.iix?t=small",
"initials": "SA",
"label": "Incident",
"document_id": "b3cf63bddb90b700b182793ebf9619a1",
"sys_created_on_adjusted": "21-03-2019 06:00:16",
"entries": {
"journal": [],
"custom": [],
"changes": [{
"sys_id": "dadfebbddb90b700b182793ebf96193e",
"sanitized_old_value": "",
"field_label": "Impact",
"is_truncated": false,
"change_type": "AUDIT",
"old_value": "",
"field_type": "integer",
"new_value": "3 - Low",
"sanitized_new_value": "3 - Low",
"field_name": "impact"
}, {
"sys_id": "5adfebbddb90b700b182793ebf96193f",
"sanitized_old_value": "",
"field_label": "Opened by",
"is_truncated": false,
"change_type": "AUDIT",
"old_value": "",
"field_type": "reference",
"new_value": "System Administrator",
"sanitized_new_value": "System Administrator",
"field_name": "opened_by"
}, {
"sys_id": "5edfebbddb90b700b182793ebf96193e",
"sanitized_old_value": "",
"field_label": "Priority",
"is_truncated": false,
"change_type": "AUDIT",
"old_value": "",
"field_type": "integer",
"new_value": "5 - Planning",
"sanitized_new_value": "5 - Planning",
"field_name": "priority"
}, {
"sys_id": "5adfebbddb90b700b182793ebf96193e",
"sanitized_old_value": "",
"field_label": "State",
"is_truncated": false,
"change_type": "AUDIT",
"old_value": "",
"field_type": "integer",
"new_value": "New",
"sanitized_new_value": "New",
"field_name": "state"
}]
},
"writable_journal_fields": ["comments", "work_notes"],
"user_id": "6816f79cc0a8016401c5a33be04be441",
"sys_created_on": "2019-03-21 05:00:16",
"sys_timestamp": 1553144416000,
"sys_created_by": "System Administrator"
}],
"primary_fields": ["comments", "work_notes"],
"fields": [{
"plural": "Additional comments",
"color": "transparent",
"name": "comments",
"isJournal": true,
"canWrite": true,
"label": "Additional comments",
"isActive": true
}, {
"name": "*Attachments*",
"isJournal": false,
"label": "Attachments",
"isActive": true
}, {
"plural": "Configuration items",
"color": "background-color: transparent",
"name": "cmdb_ci",
"isJournal": false,
"canWrite": true,
"label": "Configuration item",
"isActive": true
}, {
"plural": "Opened by",
"color": "background-color: transparent",
"name": "opened_by",
"isJournal": false,
"canWrite": true,
"label": "Opened by",
"isActive": true
}, {
"plural": "Impact",
"color": "background-color: transparent",
"name": "impact",
"isJournal": false,
"canWrite": true,
"label": "Impact",
"isActive": true
}, {
"plural": "States",
"color": "background-color: transparent",
"name": "state",
"isJournal": false,
"canWrite": true,
"label": "State",
"isActive": true
}, {
"plural": "Priorities",
"color": "background-color: transparent",
"name": "priority",
"isJournal": false,
"canWrite": true,
"label": "Priority",
"isActive": true
}, {
"plural": "Work notes",
"color": "gold",
"name": "work_notes",
"isJournal": true,
"canWrite": true,
"label": "Work notes",
"isActive": true
}, {
"plural": "Assigned to",
"color": "background-color: transparent",
"name": "assigned_to",
"isJournal": false,
"canWrite": true,
"label": "Assigned to",
"isActive": true
}],
"sys_timestamp": 1553151621000
}
As you can see, the array named "changes" is sometimes empty and other times filled.
This indicates if the state have been changed or not. (specificly tracked from the processor?)
The referenced sys_id is from sys_history_line table.
Thats my conclusion so far, and i might end up contacting HI to see if theres something else that can be done