catalog variable values in servicenow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 02:12 AM
Hi
There are two variables on a catalog item " select_owner_of_the_reports" and "selects_the_reports_name'.
I want only those reports should show to "selects_the_reports_name" variable where the the created by user is the user on " select_owner_of_the_reports" variable.
I have written a script include for this,
var reports = Class.create();
reports.prototype = Object.extendsObject(AbstractAjaxProcessor, {
initialize: function() {
},
getReportInfo: function() {
var value = current.variables.select_no_of_reports;
var owner = current.variables.select_owner_of_the_reports;
//if (value == 'Multiple Reports') {
var answer = [];
var gr = new GlideRecord('sys_report');
gr.addQuery('created_by_user', owner);
gr.query();
while (gr.next()) {
answer.push(gr.getValue('title'));
}
var qry = 'sys_idIN' + answer;
return qry;
//}
},
type: 'reports'
});
And added that script include in the Reference qualifier of that variable, but it is not working, it still showing all the reports on that variables.
Please let me know where am i making the mistake.
Thanks
Pradip Paul
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 04:46 AM
Hi @v-paulp ,
Did you tried my solution? It works fine for you? If you need anything please let me know.
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
