Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2022 03:32 AM
Background script for printing the INC no.'s that ends with 0(zero). Please guide this how to achieve.
eg: INC1234430
Solved! Go to Solution.
Labels:
- Labels:
-
Scripting and Coding
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 01:16 AM
You could achieve this after the query as well by using the regex test function
var gr = new GlideRecord('incident');
var regex = /[0]$/;
gr.query();
while(gr.next()){
var endsWithZero = regex.test(gr.number);
if(endsWithZero)
gs.print(gr.number);
}
10 REPLIES 10

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 04:45 AM
That's correct. Performance wise it would be better to use conditions in the query though, which you are hinting at.