PRINT INCIDENT CATEGORY HARDWARE & SOFTWARE WITH TOTAL COUNT IN GLIDERECORD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 07:28 PM
PLEASE HELP ME WITH THE BKOW SCRIPT TO GET THE TOTAL OF OF HARWARE AND SOFTWARE WITH LIST
var gr = new GlideRecord('incident');
gr.addQuery('category', 'software');
gr.addQuery('category', 'Hardware');
gr.query();
while(gr.next()){
OUTPUT NEEDED:
TOTAL NUMBER OF INCIDENT WITH HARDWARE CATEGORY IS - 10
TOTAL NUMBER OF INCIDENT WITH SOFTWARE CATEGORY IS - 12
Total number of incident is - 100
total number of incident with hardware and software is - 22
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 08:27 PM
Refer : https://developer.servicenow.com/blog.do?p=/post/glideaggregate/ and use glide aggregate to achieve this kind of requirements.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 08:29 PM
@RaghavSh Bhai I want this in gliderecord without encoded query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 10:39 PM
You should use Glide Aggregate as it is more recommended and faster.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 09:00 PM
@ARAVIND22 addQuery and addEncodedQuery() fetches the same results, You can use any of them.
Your question was just to print, I thought its for learning purpose so I shared the link that would help you understand glideAggregate use cases.
Raghav
MVP 2023