- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2018 03:13 AM
Hi All,
How to count the number of times the incident state sets to on-hold. And i want to send an email to caller whenever the state is on-hold along with the count.
**There is an OOB for Reopen count, is there anything similar to that we have.
How to achieve this, Kindly suggest.
Thank You
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2018 04:51 AM
Hi,
Just write before insert/Update BR with the condition as stae changes to on_hold and with that script,
var count =current.u_onhold_count;
count++;
current.setValue('u_onhold_count', count);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2018 03:19 AM
https://community.servicenow.com/community?id=community_question&sys_id=684503addbd8dbc01dcaf3231f961927

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2018 03:19 AM
Hi
You will have to configure a before business rule where you will have to check if the current.state is onHold. If on hold increase a counter variable like var cnt=0; if(current.state=on Hold){cnt = cnt+1;}
OR
There is a OOTB Metric "Incident state duration" for this purpose. It will give the count.
Mark correct if it helps.
Regards,
Omkar Mone
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2018 04:19 AM
Thanks your reply Omkar.
You will have to configure a before business rule where you will have to check if the current.state is onHold. If on hold increase a counter variable like var cnt=0; if(current.state=on Hold){cnt = cnt+1;} ======
Script logic not working.
OR
There is a OOTB Metric "Incident state duration" for this purpose. It will give the count. ==== Not giving the count.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2018 04:21 AM
Hi
Please share the code you've written for better understanding.