History of incidents not updated in every 48 hours
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 11:22 PM
Hi community ,
We are required to get a report of incidents that were not updated in every 48 hours while they were open, pending and before resolving the tickets within a month.
Is this possible to achieve, how we can see those tickets?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 11:34 PM
@Mohammed20 Yes you can achieve this by creating a metric definition so will capture data as per your requirement , you can follow below steps to achieve the same.
Define the Metric
1. Go to Metrics > Definitions and create a new metric definition.
2. Set the Table to Incident.
3. Set the Field to Updated (or Updated On).
4. In the Collection Script, use the following script to measure the time since the last update and determine if it exceeds 48 hours.
Here's a script for the metric:
// Calculate the time difference in hours between updates
var timeSinceLastUpdate = gs.dateDiff(current.sys_updated_on, current.sys_created_on, true) / 3600;
// Check if the incident is open or pending and if the time since the last update exceeds 48 hours
if ((current.state == '2' || current.state == '3') && timeSinceLastUpdate > 48) {
// Record the metric
metric.value = timeSinceLastUpdate;
metric.source = 'Incident updated after 48 hours';
} else {
// No metric recorded if the time since last update is less than 48 hours
metric.value = null;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 10:36 PM
Hi Abhay,
Script is not working and we do not want to calculate from the created time and just required to calculate within the "updated on" field because just required to see those records that never updated within 48 hours when they are in the open state.
For example one incident was created 1st of October and updated on that day after that the record on the 5th of October and then updated 10th of October, we can see the time difference is more than 48 hours between them, we need to fetch these types of record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 07:25 AM
Hi @Mohammed20 ,
You can just create a report based on updated is more than relative 48 hours ago.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 03:34 PM - edited 11-05-2024 03:35 PM
Hi @Mohammed20
I hope you are doing well!