- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 09:50 AM - edited 01-24-2025 09:52 AM
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:
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2025 11:47 AM
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);
If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2025 11:47 AM
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);
If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 05:09 AM
@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