Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Major Incident Duration field access

tomlm13
Tera Contributor

Hi,

 

I am trying to access the value of the Duration field displayed on the Major Incident Workbench. Does anyone know what this field is named?

 

MIM WB capture.PNG

1 ACCEPTED SOLUTION

I dont see any mi_duration field in incident table.

I think, mi - (stands for) - metric instance and it's a field from database view.

Hope that helps.

 

Kind Regards,

Swarnadeep Nandy

View solution in original post

4 REPLIES 4

SwarnadeepNandy
Mega Sage

Hello @tomlm13,

 

The Duration field displayed on the Major Incident Workbench is a calculated field that shows the total time elapsed since the major incident was created until it was closed or resolved. The field name for this duration is mi_duration. You can access this field by using the GlideRecord API to query the sn_major_incident table and get the value of the mi_duration field. For example:

 

// Query the sn_major_incident table for a specific major incident number
var gr = new GlideRecord('sn_major_incident');
gr.addQuery('number', 'MI0000001');
gr.query();

// Get the value of the mi_duration field
if (gr.next()) {
  var duration = gr.mi_duration;
  // Do something with the duration value
}

 

 

I hope this helps.

 

Kind Regards,

Swarnadeep Nandy

I am attempting to access this value from an email client template via the following line:

${incident_alert.source_incident.mi_duration}

 

This does not appear to work, do you have any suggestions. My end goal here is to get a current duration value to include in outage communication tasks.

I dont see any mi_duration field in incident table.

I think, mi - (stands for) - metric instance and it's a field from database view.

Hope that helps.

 

Kind Regards,

Swarnadeep Nandy

Dewayne Cudney
Giga Contributor

Were you ever able to get this to work? I am trying to get the same thing on my comms. Thanks!