- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 05:52 PM
Hi,
My company has been using the service catalog on Fuji for about 1 year. We have been populating the out of the box configuration_item field on the RITM with the names of applications from our CMDB, based on the request. On the task form for RITMs, we also have the out of box cmdb_ci field and it is populated with the names of applications from our CMDB.
We recently noticed on the RITM form, that if we want to change the configuration_item, we are not able to see all the items from the cmdb. I believe this is because there is a Reference qual condition limiting the results to cmdb_ci items with a Status of "In Stock".
Whereas on the task form for a RITM, we can see all cmdb_ci items, because there is no limitation on the results.
We have a requirement for users to be able to select applications from the CMDB on the RITM form when a generic request is submitted. What would be the recommended way to accomplish this? I am most concerned about impacting future upgrades or impacting CMDB functionality. Below are the options I am considering:
1) Update the RITM form to use the cmdb_ci field
2) Alter or remove the Reference qual condition on the sc_req_item configuration_item field
3) Update the status of items in the CMDB to "In Stock"
4) Other ideas?
Are there any downsides to any of the options I'm considering?
Any assistance would be greatly appreciated!
Jessica
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 07:23 PM
I really appreciate your sensitivity to impacting other areas of ServiceNow, but you shouldn't run into any issues.
For your purposes, I'd update the form to use the cmdb_ci field.
I can't believe that ServiceNow has created another (duplicate, for all intents and purposes) field, with the same label, no less!
If you're worried about historical data, script below to copy the contents of "configuration_item" to "cmdb_ci" (run in the Scripts - Background module). The script below will update those records "silently" so you remove the risk of accidentally sending emails, showing that *you* updated 10,000 records, etc..
var reqItemQueryGR = new GlideRecord('sc_req_item');
reqItemQueryGR.addQuery('configuration_item', '!=', '');
reqItemQueryGR.query();
var updateCount = 0;
while (reqItemQueryGR.next()){
// don't bother updating if the fields already have the same data
if (reqItemQueryGR.configuration_item == reqItemQueryGR.cmdb_ci){
continue;
}reqItemQueryGR.cmdb_ci = reqItemQueryGR.configuration_item + '';
reqItemQueryGR.setWorkflow(false); // Do not run business rules
reqItemQueryGR.autoSysFields(false); // Do not update system fields
reqItemQueryGR.update();
reqItemQueryGR.setWorkflow(true);
updateCount ++;
}gs.log("Total number of records updated: " + updateCount);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 07:23 PM
I really appreciate your sensitivity to impacting other areas of ServiceNow, but you shouldn't run into any issues.
For your purposes, I'd update the form to use the cmdb_ci field.
I can't believe that ServiceNow has created another (duplicate, for all intents and purposes) field, with the same label, no less!
If you're worried about historical data, script below to copy the contents of "configuration_item" to "cmdb_ci" (run in the Scripts - Background module). The script below will update those records "silently" so you remove the risk of accidentally sending emails, showing that *you* updated 10,000 records, etc..
var reqItemQueryGR = new GlideRecord('sc_req_item');
reqItemQueryGR.addQuery('configuration_item', '!=', '');
reqItemQueryGR.query();
var updateCount = 0;
while (reqItemQueryGR.next()){
// don't bother updating if the fields already have the same data
if (reqItemQueryGR.configuration_item == reqItemQueryGR.cmdb_ci){
continue;
}reqItemQueryGR.cmdb_ci = reqItemQueryGR.configuration_item + '';
reqItemQueryGR.setWorkflow(false); // Do not run business rules
reqItemQueryGR.autoSysFields(false); // Do not update system fields
reqItemQueryGR.update();
reqItemQueryGR.setWorkflow(true);
updateCount ++;
}gs.log("Total number of records updated: " + updateCount);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2017 11:30 AM
Thank you very much for your assistance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2017 04:14 PM
Happy to help!