Report the10 longest on hold incidents for the month
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 02:57 PM
Hi guys,
I have a question how to capture the duration from when a ticket is set to "On Hold" to now (the incident is still in "On Hold" state). I need to report the 10 longest On Hold incidents for the month.
For example, I set one incident state to "On Hold" (e.g. waiting caller) on Sept 29th, and it is still on hold today. The expected duration of "On Hold" is 4 days if I run the report today Oct 1st.
Need suggestions to achieve the above requirement.
Thank you,
Jane

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2018 11:59 AM
I don't think you'll be able to do that with the oob reporting tool. I personally don't think there's much added value to having a duration compared to the start date, but if it's absolutely necessary you're probably going to need to add a field and write some sort of script to populate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 05:36 PM
Hi Jane,
Create a new field (On Hold Duration) on Incident form and make it hidden. Create a before update BR as below.
var onHoldTime,onHoldDur;
onHoldDur = current.u_onhold_duration;
var currentTime = new GlideDateTime();
if(current.state.changesFrom('3') && current.state=='2'){
if(current.u_onhold_duration==''){
current.u_onhold_duration = gs.dateDiff(onHoldTime,currentTime, false);
}
else{
current.u_onhold_duration.setDateNumericValue(onHoldDur.dateNumericValue() + (parseFloat (gs.dateDiff(onHoldTime,currentTime, true))*1000));
}
if(current.state.changesFrom('2') && current.state=='3'){
current.u_onhold_at = gs.nowDateTime();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 08:09 PM
Hi Vikram,
Many thanks for your information, but for my scenario: the incident state has not been changed since it was set to "On Hold". I would like to capture how long the incident has been set to "On Hold" up to date. For example: the incident state was set to "On Hold" 10 days ago, and it is still in "On Hold" today, and there are not any changes made to this incident in the past 10 days. I would like to know how to capture 10 days - that is the 'duration' I'm looking for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 09:20 PM
Open the SLA record of concern incident and check the field 'Pause Duration'. This will help you.