Continuation of script to next line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2017 12:49 AM
Hi Friends.
I have to close many Incidents . i am doing it by script by hardcoding them.
Like
var chn = new GlideRecord('incident');
chn.addQuery('number','IN','INC0051502,INC0051172,INC0051088,INC0051334'); like this i have to provide some 500 incidents.
The above statement is working for 4 incidents.But how to hardcode 500 incidents .
Like
chn.addQuery('number','IN','INC0051502,INC0051172,INC0051088,INC0051334',
INC0051502,INC0051172,INC0051088,INC0051334,INC0051502,INC0051172,INC0051088,INC0051334,
INC0051502,INC0051172,INC0051088,INC0051334');
The above statement is showing error as i not providing end of line and start of line symbols/commands ..
Please let me know how to continue to next line.
Thank you very much in advance.
regards
Aarav
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2017 12:50 AM
Use addOrCondition()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2017 12:51 AM
Check this link for syntax and usage
http://wiki.servicenow.com/index.php?title=GlideRecord#addOrCondition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2017 01:00 AM
Thank you for your time Aakash on this.
But i am not able to locate my requirement in that.
thanks again.
Aarav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2017 01:10 AM
var chn = new GlideRecord('incident');
chn.addQuery('number','INC0051502').addOrCondition('number','INC0051088').
and so on.
As Harsh said, if you have anything common in these Incidents then it would be easier to query through the records.