- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2019 02:21 PM
I'm trying to run a report off a table, and only want to display the most recent record created. For example below. I see that this report displays 126 records. I want to be able to display/show only the last record created. Or most recent record. What condition/s should I use, to give me the last record created.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2019 03:32 PM
Your Report Filter condition should be
sys_id = javascript: new jira().runReport()
script include code with Client Callable Checkbox checked.
var jira = Class.create();
jira.prototype = {
runReport: function()
{
var gr = new GlideRecord("u_jira_projects");
gr.orderByDesc("sys_created_on");
gr.query();
if (gr.next()) {
return gr.getValue('sys_id');
}
},
type: 'jira'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2019 02:29 PM
Below thread may help, which would require you to write a script include and call it in the filter condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2019 02:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2019 03:32 PM
Your Report Filter condition should be
sys_id = javascript: new jira().runReport()
script include code with Client Callable Checkbox checked.
var jira = Class.create();
jira.prototype = {
runReport: function()
{
var gr = new GlideRecord("u_jira_projects");
gr.orderByDesc("sys_created_on");
gr.query();
if (gr.next()) {
return gr.getValue('sys_id');
}
},
type: 'jira'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2019 04:14 PM