Note

 

This documentation supports the 20.18.01 version of BMC Remedyforce.

To view the latest or an earlier version, select the version from the Product version menu.

Deleting configuration items

If you have CIs that are no longer being used or you are discarding them, such as old hardware, you can delete these CIs to ensure that you have an accurate representation of the CIs in your IT environment. When you delete a CI from the database, all relationships associated with that CI are also deleted.

Note

If you do not have the Delete permission on the class of an asset, you cannot delete the assets of that class; the Delete toolbar icon for the assets of that class is disabled.

To delete a configuration item

  1. Click the Remedyforce CMDB tab.
  2. In the right pane of the CMDB Manager, select the CI that you want to delete.
    To search for a CI, type initial characters of the name of the CI or the full name of the class name in the Search text box and click Search .
    For example, to search for Email Service CI, you can type Email or Email Service in the Search text box and click Search. You can also search using data in the Instance IDInstance NameDescriptionClass NameAsset #Token ID, and Serial # fields. If you select a class in the left navigation pane, only the CIs of that class are searched. To search all classes, select the Base Element class in the left navigation pane.
  3. Click Delete.

    Note

    If you do not have the Update and Delete CMDB user permission for CI Management View, the Delete toolbar icon for the CIs of a class is disabled. If both CI and asset management are enabled, to be able to delete a CMDB instance of the instance type CI/Asset from the All tab of Remedyforce CMDB, you must have Update and Delete CMDB user permission for both CI Management View and Asset Management View. Otherwise, the Delete toolbar icon is disabled. 

  4. In the confirmation dialog box, click Yes.

You can delete one or more CIs from the Base Element object of the CMDB by using Salesforce Object Query Language (SOQL) query, Salesforce page layout, the data loader, or the Pentaho Data Integration tool. When you delete a CI, the CI relationships, CI client links, and CI tasks links are also deleted.

Deleting a CI and asset record

When both CI and IT asset management are enabled, if you select a CI/Asset instance and click Delete, the following delete options are available based on your CMDB user permissions and the tab that you have selected on the left navigation pane of the Remedyforce CMDB tab:

Tab on the left navigation paneAvailable delete options
CI
  • If you have Update and Delete permission for both CI Management View and Asset Management View, you are prompted to select Delete from Assets and retain CI elementDelete from CIs and retain Asset element, or Delete from Assets and CIs. By default, Delete from CIs and retain Asset element is selected. If you select Delete from Assets and CIs, the record is permanently deleted from the Remedyforce CMDB.
  • If you have Update and Delete permission for CI Management View, and a permission other than Update and Delete for Asset Management View, you are prompted to select Delete from Assets and retain CI elementDelete from CIs and retain Asset element, or Delete from Assets and CIs. However, only the Delete from CIs and retain Asset element option is enabled.
  • If you have a permission other than Update and Delete for CI Management View,  and any permission for Asset Management View, the Delete toolbar icon is disabled.
Asset
  • If you have Update and Delete permission for both CI Management View and Asset Management View, you are prompted to select Delete from Assets and retain CI elementDelete from CIs and retain Asset element, or Delete from Assets and CIs. By default, Delete from Assets and retain CI element is selected. If you select Delete from Assets and CIs, the record is permanently deleted from the Remedyforce CMDB.
  • If you have Update and Delete permission for Asset Management View and a permission other than Update and Delete for CI Management View, you are prompted to select Delete from Assets and retain CI elementDelete from CIs and retain Asset element, or Delete from Assets and CIs. However, only the Delete from Assets and retain CI element option is enabled.
  • If you have a permission other than Update and Delete for Asset Management View, and any permission for CI Management View, the Delete toolbar icon is disabled.
All
  • If you have Update and Delete permission for both CI Management View and Asset Management View, you are prompted to select Delete from Assets and retain CI elementDelete from CIs and retain Asset element, or Delete from Assets and CIs. By default, Delete from Assets and CIs is selected, which permanently deletes the record from the Remedyforce CMDB.
  • If you have Update and Delete permission for Asset Management View and a permission other than Update and Delete for CI Management View, you are prompted to select Delete from Assets and retain CI elementDelete from CIs and retain Asset element, or Delete from Assets and CIs. However, only the Delete from Assets and retain CI element option is enabled.
  • If you have Update and Delete permission for CI Management View and a permission other than Update and Delete for Asset Management View, you are prompted to select Delete from Assets and retain CI elementDelete from CIs and retain Asset element, or Delete from Assets and CIs. However, only the Delete from CIs and retain Asset element option is enabled.

To delete configuration items by using the Developer Console

  1. Navigate to the Developer Console.
  2. Click the text box next to the Execute button.
  3. Enter a script to delete the CIs. BMC recommends that the batch size for the query should be 50.
    • Example: To delete CIs that are marked to be deleted from a specific CI class, use the following script:
    • Delete [Select ID From BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__class__c = 'BMC_IPEndpoint' AND BMCServiceDesk__MarkAsDeleted__c = TRUE Limit 50]
    • Example: To delete records from a CI class based on which Rule Based Asset classes are defined, use the following script:

      List< BMCServiceDesk__BMC_BaseElement__c> BEList = [select Id, BMCServiceDesk__InstanceType__c, BMCServiceDesk__DeleteStatusCode__c from BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__class__c = 'BMC_ComputerSystem' Limit 50];
      List<BMCServiceDesk__BMC_BaseElement__c> updInstList = new List<BMCServiceDesk__BMC_BaseElement__c>();
      List<BMCServiceDesk__BMC_BaseElement__c> delInstList = new List<BMCServiceDesk__BMC_BaseElement__c>();
      for(BMCServiceDesk__BMC_BaseElement__c inst : BEList){

          if(String.valueOf(inst.BMCServiceDesk__InstanceType__c) == 'CI / Asset')
              inst. BMCServiceDesk__DeleteStatusCode__c = 2;
              updInstList.add(inst);
          }else{
              delInstList.add(inst);
         
      }
      }

      if(updInstList != null && updInstList.size() > 0){
          update updInstList;
      }
      if(delInstList != null && delInstList.size() > 0){
          delete delInstList;
      }

    •  Example: To permanently delete the records from a CI, asset, or CI and Asset class, use the following script:

      List<BMCServiceDesk__BMC_BaseElement__c> BEList = [select Id from BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__class__c = 'BMC_IPEndpoint' Limit 50];
      delete BEList;

    • Example: To delete only CIs from a CI and Asset class:

      List< BMCServiceDesk__BMC_BaseElement__c> BEList = [select Id, BMCServiceDesk__DeleteStatusCode__c from BMCServiceDesk__BMC_BaseElement__c where BMCServiceDesk__FKAssetRuleClass__r. BMCServiceDesk__ClassName__c = 'BMC_Monitor' Limit 50];
      for(BMCServiceDesk__BMC_BaseElement__c inst : BEList){
      inst. BMCServiceDesk__DeleteStatusCode__c = 2;
      update BEList;

  4. Click Execute.
Was this page helpful? Yes No Submitting... Thank you

Comments