how to Find all active incidents where the category is software or hardware in Glide Record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2018 09:03 PM
how to Find all active incidents where the category is software or hardware in Glide Record?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2018 09:11 PM
Hi Ram,
Use the following code in your Business Rule
//Change the gliderecord variable as per need
var gr = new GlideRecord('incident');
gr.addEncodedQuery('active=true^category=hardware^ORcategory=software');
gr.query();
while (gr.next()) {
//do something
}
Regards,
Aakash Shah
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2018 09:14 PM
Try something like below
var incList=[];
var gr=new GlideRecord('incident');
gr.addEncodedQuery('active=true^categoryINsoftware,hardware');
gr.query();
while(gr.next())
{
incList.push(gr.number);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2022 11:07 PM
Hi Ram,
You Can Try this simple code in your scenario.
var list=[];
var gr=new GlideRecord('incident');
gr.addActiveQuery();
gr.addEncodedQuery('active=true^category=software^category=hardware');
gr.query();
while(gr.next())
{
list.push(gr.getValue());
}
gs.print(list);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2022 11:40 PM
We can Write GildeRecord Query To find out Record.
Var gr=new GlideRecord('incident');
gr.addEncodedQuery('active=true^category=hardware^ORcategory=software');
gr.query();
while(gr.next())
{
gs.addInfoMeassage("All Record"+gr.number);
}
Please Mark Helpful or correct
Thanks