- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 07:24 AM
Can someone guide me on how to create this heatmap? I already tried this link - https://docs.servicenow.com/bundle/quebec-it-asset-management/page/use/performance-analytics/task/cr... but the 2nd breakdown list is empty and has no options for me to choose a breakdown. Can you provide instructions on how to create this particular heatmap. See photo. Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 12:49 PM
Hi Greg,
Here's how I would do it with standard reporting (not PA):
It requires creation of 2 custom fields of Integer type (in the Task table): u_day_of_month and u_hour_of_day.
These 2 fields will be maintained by the following 2 BRs:
(function executeRule(current, previous /*null when async*/) {
var gdt = new GlideDateTime(current.sys_created_on);
current.u_day_of_month = gdt.getDayOfMonthLocalTime();
})(current, previous);
(function executeRule(current, previous /*null when async*/) {
var gdt = new GlideDateTime(current.sys_created_on);
glt = gdt.getLocalTime();
current.u_hour_of_day = glt.getByFormat('HH');
})(current, previous);
JP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 12:49 PM
Hi Greg,
Here's how I would do it with standard reporting (not PA):
It requires creation of 2 custom fields of Integer type (in the Task table): u_day_of_month and u_hour_of_day.
These 2 fields will be maintained by the following 2 BRs:
(function executeRule(current, previous /*null when async*/) {
var gdt = new GlideDateTime(current.sys_created_on);
current.u_day_of_month = gdt.getDayOfMonthLocalTime();
})(current, previous);
(function executeRule(current, previous /*null when async*/) {
var gdt = new GlideDateTime(current.sys_created_on);
glt = gdt.getLocalTime();
current.u_hour_of_day = glt.getByFormat('HH');
})(current, previous);
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2023 06:43 AM
Thank you very much. This worked out and was exactly what I needed! One question I have though; I noticed once I created the report with your script; It does not backfill all the incidents with "day of month" and "hour of the day". So for example, I implemented your script yesterday 1/5/23 at 5PM EST and only those tickets going forward are reflecting in the heatmap/report. But any tickets prior to 1/5/23 at 5PM EST that were created are not appearing. Is there a way to have that happen? Thanks again!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2023 06:52 AM
Hi Greg
Exact, as you can see in the 2 BRs, it is updating the 2 fields on Insert and Update, so for old records, you will have to update them.
JP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2023 11:45 AM
Hi Greg,
Please mark the solution if you are happy with the result; this may helps others.
JP