Reference qualifier is showing only one value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 05:28 AM
Hello,
I am calling script include in reference qualifier and i am getting only one value, instead of showing related values.
script include i am using:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 05:51 AM - edited 10-29-2024 05:52 AM
Hi @Kumar147 ,
Typo error during calling script include in reference qualifier :
adv ref qual condition: javascript: new scriptinclude().platform();
And put return statement outside while loop.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you found my response **helpful**, I’d appreciate it if you could take a moment to select **"Accept as Solution"** and **"Helpful"** Your support not only benefits me but also enriches the community.
Thank you!
Moin Kazi
www.linkedin.com/in/moinuddinkazi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 05:59 AM
Hello @Moin Kazi
I tried that but no luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 06:06 AM
what is your script include name and please share pic how you called it in reference qualifier?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 06:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 06:28 AM
Hi @Kumar147 ,
You cannot use the current object inside a Script Include without passing it as a parameter to your function.
Please pass the current object to your function as shown below:
javascript: new appapplication().platform(current.getValue('cmdb_ci'))
And structure your Script Include like this:
platform: function(app) {
var gr = new GlideRecord('u_rm_data_management');
gr.addEncodedQuery('u_active=true^u_type=Choice^u_item=App Platform^u_applicationsLIKE' + app);
gr.query();
var result = [];
while (gr.next()) {
result.push(gr.sys_id.toString());
}
return 'sys_idIN' + result.join(',');
},