- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 10:17 PM
Hi all,
I am try to calculate the total hours of duration in background. I wrote script in background script. It getting all duration values from different records. But I need sum of the total duration and convert in to Mints or seconds.
Can you please help me on that.
I am using below script, and for reference I have attached screenshot
Thank you,
Siva
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 12:11 AM
Hello @Siva82 ,
My bad can you try with this script please?
var dur=0;
var gr = new GlideRecord('cmdb_ci_outage');
gr.query();
while(gr.next())
{
dur=dur+gr.duration.dateNumericValue()/(60*60*1000);
}
gs.info(dur);
Please add your queries accordingly and run the script
This gave the result in total hours as i converted it to hours
Hope this helps
Mark my answer correct if this helps you
Thnkas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 03:54 AM