Background Script to check the length of a short description of 100 incidents at one Shot:

hussain h1
Tera Contributor

Hi All,

I wanted to Run a background script where I need to check the short description which has exact length =100 for all incidents.

Kindly suggest on this.

Regards,

Hussain

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hi,



Please run this script.



var inc = new GlideRecord('incident');


inc.query();


while(inc.next()){


  if(inc.short_description.toString().length == 100){


    gs.print(inc.number);


}


}



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

7 REPLIES 7

I understand that, but i wouldn't really just go on running this script...there are multiple things to be considered and thats why i asked the actual need here.



Simply put, running this script on a customer instance, chances are high that it will time out or might impact the performance badly.


-Anurag

Agree with that, It should be just executed directly on a production instance.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


Alikutty A
Tera Sage

Hi Hussain,



Please make sure you have gone through the discussion in this thread. The code should be tested on a lower instance first and you also need to verify the current length of the short description field is greater than 100.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response