How to safely remove the CI to asset relationship without deleting the CI record?

Allen_Deepak
Mega Guru

Hello All,

 

I have a scenario where the one of the VM model has been wrongly set to 'create asset records' during asset and CI creation which ended up creating both assets and CI. But in this case, we are supposed to have only CI records and not asset records as they are not physical assets. I have corrected the model to stop creating assets. and also i'm trying to delete the asset record which is also deleting the CI record which is not supposed to happen.

 

Any idea how to safely remove the asset and CI relationship and then delete only asset record?

 

Thanks.

1 ACCEPTED SOLUTION

Allen_Deepak
Mega Guru

Hello All, Thank you for the response.

I found a better way without script in this link Solved: Delete Asset Record without deleting the CI - ServiceNow Community

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi @Allen_Deepak ,

Maintain the integrity of the CMDB by deleting any CI relationships that are no longer relevant or needed for a CI. Use the relationship editor to delete CI relationships.

Before you begin

Role required: ITIL or asset

Note: Deleting a relationship to a dependent CI can result in identification problems as the dependent CI will no longer have a relationship to the CI it depends on.

Procedure

  1. Launch the relationship editor:
    1. Open the CI form of the CI for which you want to delete a relationship.
    2. Locate the Related Items section near the center of the form.
    3. Click the plus (+) icon on the Related items section.
  2. In the Relationship Editor, in the Relationships section, select the relationships that you want to delete for the CI.
  3. Click the Delete selected relationships icon.
  4. Click Save or Save and Exit.

 

Hi @Community Alums   Thank you for the response.

 

The relationship editor doesn't show up the CI to asset relationship.

but yes, we can add and remove other CI dependent relationships like VMIs, related servers, clusters, etc,..

 

That doesn't work for asset to CI relationship? Any other way to manually remove them without scripting?

 

Thanks.

 

luffy3478
Tera Guru

delete them using background script with setWorkflow(false)

or

unlink the assets first and them delete them

maroon_byte
Mega Sage

Steps:

1. On the Asset records, clear the CI field and save

2. On the CI records, clear the Asset field and save

3. Delete the asset records