- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 07:51 AM
Hi All,
I am doing some clean up and need help. I extended the CMDB_CI table and added a class called "Mobile Devices" for our phones and tablets but I didn't use the "NAME" field and now I can't see them from the reference field on my incident form.
Could someone share a script that will do the following?:
Table "u_mobiles devices"
If "u_imei_string" is not empty, copy the value in to the "name" field.
I plan to put a business rule in place to copy this in the future or I can just add the name field to the form.
Please let me know thoughts and if you are willing to share a script.
Thank you
Carl
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 07:59 AM
var gr = new GlideRecord('u_mobiles_devices');
gr.query();
while (gr.next()) {
var x = gr.getValue('u_imei_string');
if (x) {
gr.setValue('name', x);
gr.update();
}
}
You could run that as a background script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2017 08:49 AM
thank you Sanjiv, This was my plan to fix moving forward but had to get the clean up script first. Appreciate your help!