On Hold Reason displays for InProgress Tickets in Report

SNOW46
Tera Contributor

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.

find_real_file.png

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

1 ACCEPTED SOLUTION

Brian Lancaster
Tera Sage

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();
}

View solution in original post

4 REPLIES 4

Brian Lancaster
Tera Sage

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 --.

find_real_file.png

find_real_file.png

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

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.

Brian Lancaster
Tera Sage

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();
}