History of incidents not updated in every 48 hours

Mohammed20
Tera Contributor

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!

5 REPLIES 5

Abhay Kumar1
Giga Sage

@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;
}

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.

AndersBGS
Tera Patron
Tera Patron

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/

AbdulNow
Tera Guru

Hi @Mohammed20 

 

I hope you are doing well!

 

A straightforward approach is to create a report on the Incident table and apply the filter shown in the screenshot below.
 
Wahid4_0-1730849706675.png

 

 
 
 
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Wahid