how to fetch OT asset name from cmdb_ci table through scripting ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 09:40 AM
Hi,
i have a requirement where i need to fetch OT asset display name/name from cmdb_ci table based on site value and then the value which will be returned that i need to set on catalog item variable.
I have created a script include and catalog client script but unfortunately getting blank value from cmdb_ci table.
Thanks in advance for your help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 09:42 AM
@Jyoti Mehta Could you please post your catalog client script and script include script here. This will enable us to make right suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 10:14 AM
Hi Sandeep,
Please find details below:
function created in script include:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 10:25 AM
@Jyoti Mehta Could you please update your script include method as follows and let me know if it works.
getOTAssetname:function(){
var sysidofsite = this.getParameter('sysparm_value');
var gr1 = new GlideRecord('cmdb_ci');
gr1.addQuery('sys_id',sysidofsite);
gr1.query();
if(gr1.next()){
return gr1.getValue('ot_display_name');
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 10:57 PM
Hi Sandeep,
I have tried this script but still it is not working.