- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2017 03:39 AM
Hello Everyone,
I have a requirement where i need to check wheather the incident are closed or not, i have more than 1000 records how to run the background scirpt to get count in one shot.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2017 03:49 AM
Hey Irfan,
You can form the queries in the query builder of the incident list . and then copy the query. by right clicking the filter and copy query like shown below
No write your script.
var gr = new GlideRecord('incident');
gr.addEncodedQuery('incident_stateIN6,7');
gr.query();
while(gr.next()){
// do something;
}
Thanks,
Sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2017 04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2017 03:51 AM
you use encoded query like this: active=true^categoryINrequest,inquiry,software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2017 03:52 AM
ar gr = new GlideRecord('incident'); gr.addEncodedQuery('active=true^categoryINrequest,inquiry,software'); gr.query(); while(gr.next()){ // do something; }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2017 04:01 AM
Hi Irfan,
You can check How many Active incidents are there in Incident Table.
var gr = new GlideRecord('incident');
gr.addActiveQuery();
gr.query();
if(gr.next()){
gs.print("Count : "+gr.getRowCount());
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2017 04:03 AM
Pavan,
I have 1000 of correlation_ids with this i need to check how many are Closed & How many are opened. Can you please help me out with this
