- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2017 07:40 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2017 07:44 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2017 07:43 AM
Hi Hussain,
We can write that script but i would like to understand what exactly are you trying to identify?? what is the business case here?
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2017 07:44 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2017 07:59 AM
Just a word of caution here...in the OOB vanilla instance the length of short_description field is 80 chars and not 100.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2017 08:08 AM
I do see 160 as default in my instance. I believe the script is for one time purpose for validating.
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response