To auto-populate printer CIs name as serial number + model name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 02:32 AM
Hi All,
When we create printer CIs, the name of printer should auto-populate as serial number + model name.
Model name field is not available on printers table but model id is available. Kindly let me know how we can achieve this.
Thanks in Advance!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 02:43 AM
Hi @PriyaRaj
Create a Business Rule with below script, or use this as default value for the name field.
var printerName = current.serial_number + ' - ' + current.model_id.name;
current.name = printerName;
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 03:38 AM - edited 10-03-2023 03:45 AM
Hi @PriyaRaj ,
Write after insert business rule in cmdb_ci_printer table add below script.
(function executeRule(current, previous /*null when async*/) {
var model = new GlideRecord('cmdb_model');
if (model.get(current.model_id)) {
current.name = current.serial_number + ' ' + model.name;
}
})(current, previous);
Thanks,
Anand