- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 02:40 AM
Hi,
I have a script which runs fine and displays the results well in the scripts Background.
How do I display the script results in service now as a page and have this script run daily?
var dupRecords = [];
var gaDupCheck1 = new GlideAggregate('cmdb_ci_computer');
gaDupCheck1.addQuery('model_category','laptop');
gaDupCheck1.addAggregate('COUNT', 'asset_tag');
gaDupCheck1.groupBy('asset_tag');
gaDupCheck1.addHaving('COUNT', '>', 1);
gaDupCheck1.query();
while (gaDupCheck1.next()) {
dupRecords.push(gaDupCheck1.asset_tag.toString());
}
gs.print(dupRecords);
Does not have to be anything fancy as long as it displays the results.
Thanks,
Riaz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 04:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 04:20 AM
Hi Kalairasan - Good point however this is to tackle duplicate Asset Stickers. We now have no duplicate stickers so just need a clear up on the ones in the system.
The field in SNOW automatically pulls the number from SCCM when the machine is being built.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 04:23 AM
From your comment, are you wishing for a one time job? If that is the case, creating a UI page doesn't make any sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 04:27 AM
Hiyah - All i need is a simple list which shows the duplicate asset numbers that the team can work through.
Once we clear these up the list becomes redundant
I do see your point however we only have a collection of duplicate asset numbers which we just need to easily show and work through
Thanks,
Riaz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 04:32 AM
Even if that is the case, you should rather be creating a report rather than a UI page. You can easily add that to a dashboard or share them between team or even schedule them as email.
Well anyways, its your decision and not my to take. Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2017 04:35 AM
You have a good point - my scripting skills are limited so am just trying to make it simple.
If I can get this as a report with some fields that would be great. You raise some good points...