Display one field of a table in a form on ESC but use a different field in the submitted incident

Rob Banks
Tera Contributor

Hi all. I apologize for the title, I'm having a hard time with how to easily say what I am trying to achieve (which probably is leading to me not being able to search for help well). Best to use an example of what I'm trying to achieve. To start, we are using a client script to create the incidents from the record producers. We have a few different record producers that we use a lookup select box on the Application Service table to select an impacted app for the incident. The name field is not very user friendly in the table, so we are setting the short description as the lookup value field on the variable:

 

RobBanks_0-1737740718510.png

What I'm wanting to achieve, though, is to still 'use' the Name field when the incident is actually created. If I am able to call/reference (unsure of verbiage, my apologies) the Name field of the selected variable, I can map that to the Configuration Item field on the incident. When using the short description as lookup value field, it does not map anything to this field. If I switch the lookup value to 'Name' then it will map to the CI field in the incident. Specific part of the script for this right now is:

 

current.cmdb_ci.setDisplayValue(producer.Q_49_please_select_the_application);

 

My apologies if this is simple, but we're still building our environment and I haven't had time to actually look into and learn scripting; I've just been reverse engineering things as I go to move along as best we can. Any guidance is appreciated, even if it's just "Yes this is possible, look into 'x and y' to see how to do it" would be great.

 

Thanks,

Rob

1 ACCEPTED SOLUTION

Najmuddin Mohd
Mega Sage

Hi @Rob Banks ,

If I understand, you are displaying the Short Description of the CI and you want it to map the CI to the Configuration Item.

To do this, you need to get the SysID of the record. 
So, GlideRecord the table and filter the short description and return sysID of the record.


You can check the below script:

var shortDescription = cmdb_ci = producer.select_application_service; 

var grApplicationService = new GlideRecord('cmdb_ci_service_auto');
grApplicationService.addQuery('short_description',shortDescription);
grApplicationService.query();
grApplicationService.next();

current.cmdb_ci = grApplicationService.sys_id;
//gs.log('SYS_ID: ' + grApplicationService.sys_id);

 

NajmuddinMohd_4-1737834162362.png

 

NajmuddinMohd_5-1737834231111.png

 



NajmuddinMohd_3-1737834124002.png

 

NajmuddinMohd_6-1737834335371.png

 



 

NajmuddinMohd_2-1737834095816.png


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

 



View solution in original post

2 REPLIES 2

Najmuddin Mohd
Mega Sage

Hi @Rob Banks ,

If I understand, you are displaying the Short Description of the CI and you want it to map the CI to the Configuration Item.

To do this, you need to get the SysID of the record. 
So, GlideRecord the table and filter the short description and return sysID of the record.


You can check the below script:

var shortDescription = cmdb_ci = producer.select_application_service; 

var grApplicationService = new GlideRecord('cmdb_ci_service_auto');
grApplicationService.addQuery('short_description',shortDescription);
grApplicationService.query();
grApplicationService.next();

current.cmdb_ci = grApplicationService.sys_id;
//gs.log('SYS_ID: ' + grApplicationService.sys_id);

 

NajmuddinMohd_4-1737834162362.png

 

NajmuddinMohd_5-1737834231111.png

 



NajmuddinMohd_3-1737834124002.png

 

NajmuddinMohd_6-1737834335371.png

 



 

NajmuddinMohd_2-1737834095816.png


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

 



@Najmuddin Mohd Thank you so much! I tested this and it worked. This will save a lot of headaches for us; I really appreciate it.

 

Rob