Show the value of the CI's Class

yvonnew
Kilo Guru

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.

 

 

 

2 REPLIES 2

rammohanraomadd
Kilo Guru

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

Shweta KHAJAPUR
Tera Guru

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);