Need script to alread existing incident where reassignment count is 1 but no group changed in ticket

nitin51
Tera Contributor

when incidents are getting created via inbound action, reassignment count showing as 1.

which was fixed but I want script to edit previous incidents where reassignment count i 1 but no group changed.

this has happened for few incidents intermittently, not for all.

 

 

3 REPLIES 3

AshishKM
Kilo Patron
Kilo Patron

Hi @nitin51 

You can write code in Fix Script to reduce reassignment count by 1 for given list of incident.

var incidentList = "numberININC1,INC2,INC3"; // replace INC1,INC2,INC3 with the actual incident number
var grINC = new GlideRecord("incident"); 
      grINC.addQuery(incidentList ); // update the incidentList variable with actual incident numbers
      grINC.addQuery("reassignment_count>0"); // Check for this condition
      grINC.query();
      while(grINC.next()){
      grINC.reassignment_count = grINC.reassignment_count-1;
      grINC.udpate();
}

Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

nitin51
Tera Contributor

Hi Ashish,

Thanks very much, 

As issue in intermittent, it has happened with few incidents.

is it possible to get those incident via any query??

 

If not I don't have option, but to manually update the incidents in script and run.

 

How do you know that "it happened with few incidents", either you have list of such incidents or someone reported this observation. 

 

So with that assumption, you need to perform "due diligence" and find out the business impact and if it's  minor thing then don't update this count, leave it.

 

You can apply filter on List View where this "reassignment count" is more than 0 ( add more applicable condition, if applied ) 

 

AshishKMishra_0-1708617080428.png

 

I can guess, some business team who is mainly concern about "reporting metrics" may ask this to update.


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution