- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 11:59 AM
Is it possible to create a report that pulls random cases/requests based on the assigned to?
Or how could I create a page or module that would pull a random list of records based on the assigned to in a scoped application?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2017 12:48 PM
I found the following solution on another community post.
Create a UI Page:
[CODE]
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
window.onload = function() {
randomCase();
};
</script>
</j:jelly>
[/CODE]
Client Script:
[CODE]
function randomCase(){
var caseList = [];
var rec = new GlideRecord('table');
rec.addQuery('active', true);
rec.addQuery('investigator', 'IN', 'Name1,Name2,Name3,Name4');
rec.query();
while (rec.next()){
caseList.push(rec.getValue('number'));
}
var random = Math.floor((Math.random() * caseList.length));
var selected = caseList[random];
var txt = selected;
window.location = ("https://instance.service-now.com/nav_to.do?uri=x_whba_table.do?sysparm_query=number=" + selected);
}
[/CODE]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 12:17 PM
Hello Kaniel,
You can create a report and pull the results as per defined filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 12:22 PM
I need something like a random ticket number generator...a way to pull a random ticket for audit purposes. Can this be done with a report?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2017 12:48 PM
I found the following solution on another community post.
Create a UI Page:
[CODE]
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<script>
window.onload = function() {
randomCase();
};
</script>
</j:jelly>
[/CODE]
Client Script:
[CODE]
function randomCase(){
var caseList = [];
var rec = new GlideRecord('table');
rec.addQuery('active', true);
rec.addQuery('investigator', 'IN', 'Name1,Name2,Name3,Name4');
rec.query();
while (rec.next()){
caseList.push(rec.getValue('number'));
}
var random = Math.floor((Math.random() * caseList.length));
var selected = caseList[random];
var txt = selected;
window.location = ("https://instance.service-now.com/nav_to.do?uri=x_whba_table.do?sysparm_query=number=" + selected);
}
[/CODE]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2024 11:31 PM
But how it pulls the report based on assigned to user here?