Show the value of the CI's Class
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 03:45 AM
I am trying the get the actual value of the class of a CI into a catalog item, e.g. AIX Server, Windows Server, with no luck.
We have catalog client scripts which will happily put value's such as the description of a CI into a catalog item, a snippet of the script is shown below.
g_form.setValue('u_ci_description', summary.short_description); //where summary is the name of the CI from an earlier query.
I have tried to do the same to get the CLASS of the CI, e.g. AIX Server, Windows Server, to populate also but at the moment nothing gets populated into the field.
I was trying this but it does not work, the field is blank.
g_form.setValue('u_ci_class', summary.sys_class_name.getDisplayValue());
Any suggestions? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 04:30 AM
Hi,
Please create a Script Include (Client Callable) and pass the CI value (sys_id) into the script include and from the you can get the Table Label.
.getDisplayValue() will work in Server Side Script.
Regards,
Ram M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 05:06 AM
Hi,
Try with below code,
var ci=g_form.getReference('summary');//if summary is reference variable holding ci
var class=ci.sys_class_name; //you'll get ci class
g_form.setValue('u_ci_description', ci.short_description);