- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2019 05:28 AM
Hi All,
I am creating a multi pivot report where Status and On hold reason is on top and assignment group on left. When I do this, I get few tickets on hold reasons for In Progress tickets. So I want to make some changes in back end if the ticket status is changed from on hold to any other state, then the on hold reason field should go blank for other states.
Can anyone let me know how to fix this issue so that On Hold Reason will not display for other States in reports and it will only be applicable for On Hold State.
Thanks,
SNOW@Das
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2019 06:05 AM
Also here is a script that you can run on script - backgorup in the left nav to fix the incidents. This is assuming you are using the OOB states so you should confirm and test it in a non prod instance.
var gr = new GlideRecord('incident');
gr.addQuery('state','IN','1,2,6'); //state is New, In Progess, Resolved
gr.query();
while (gr.next()){
gr.hold_reason = '';
gr.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2019 05:44 AM
There should be an OOB business rule called "Clear On Hold Reason". Make sure it is active. If it is not there is is a very simple business rule you can recreate. It is before Insert / update with two conditions. State changes and state is not On Hold. Then in the actions table next set field values choose On Hold reason to -- None --.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2019 07:03 AM
Hi Brian,
So my query is will it remove the On Hold Reason Values under In Progress State in the Report. And the On Hold Reasons should come under On Hold State in the report.
I have configured the BR based on your suggestion but the On Hold Reason Values are still under In Progress in the Report. So for this do I need to run the fix script so it will get cleared from the report or how it is going to work for me. Need your help on the same.
Thanks,
SNOW@Das

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2019 09:58 AM
I posted a script below to remove the on hold reason for existing ticket that are not in an on hold state. Once that is run if the state is not on hold it should not show an on hold reason in the report.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2019 06:05 AM
Also here is a script that you can run on script - backgorup in the left nav to fix the incidents. This is assuming you are using the OOB states so you should confirm and test it in a non prod instance.
var gr = new GlideRecord('incident');
gr.addQuery('state','IN','1,2,6'); //state is New, In Progess, Resolved
gr.query();
while (gr.next()){
gr.hold_reason = '';
gr.update();
}