Import Rule fails to set or remove Asset Owner or Cost Center
search cancel

Import Rule fails to set or remove Asset Owner or Cost Center

book

Article ID: 155139

calendar_today

Updated On:

Products

IT Management Suite Client Management Suite Asset Management Suite

Issue/Introduction

When a Data Connector Import Rule is used that is expected to set the Asset Owner and/or the Cost Center for a resource, it fails to do so or it removes the prior values. This was found by editing an imported/updated resource or by reviewing Configuration Item reports that show this data.

Various or none. For example:

Row x skipped for data class 'Ownership Details'. No value has been specified for non nullable destination column 'Ownership Percentage' and there is no existing value for this column in the NS database for this resource.

Environment

ITMS 8.x

Asset Management Solution 8.x

Cause

Both "issues" are working as designed.

If the Asset User or Cost Center is not being set, the Import Rule is not setting both the Ownership Details/Cost Center Ownership data classes and the Asset User Owners/Cost Center association.
 
If the ownership is later disappearing, when the CMDB task Clean Ownership next runs, this will attempt to match both the data class and association. If there are not values for both, partial asset owner settings are removed from the affected resources.

Resolution

Ensure that the correct data class and association are made for Users and Cost Centers. Figure 1 displays which to add for each type.
 
Figure 1: Example of how to fully configure User and Cost Center associations to a resource.

For Users (highlighted above in red):

  • Add and assign the data class mapping of Ownership Details, which includes the Owner and Ownership Percentage. Tip: The Ownership Percentage must be provided and cannot be blank (null). This can either be done via the data file or manually in the Import Rule by setting the Source to <Value> = 100.
  • Add and assign the association mapping of Asset User Owners.
  • To add these:

    1. Click on "Select data classes".
    2. Click on the Group drop down list to expand it.
    3. Click on the CMDB Data Classes parent folder. Tip: This folder will be used, not those folders under it. Each folder contains its own data classes, along with possibly sub-folders that have their own. Figure 2 displays this.
    4. Click on Ownership Details.
    5. Click on the ">" button to add Ownership Details to the "Selected items" list.
    6. Click on the OK button.

    Figure 2: Click on the "CMDB Data Classes" folder to see its specific data classes, and also any sub-folders.

    7. Click on "Select associations".
    8. Click on the Group drop down list to expand it.
    9. Click on the "CMDB Association Types" parent folder. Tip: As with step 3, this is from this folder, not those under it.
    10. Click on Asset User Owners.
    11. Click on the ">" button to add Asset User Owners to the "Selected items" list.
    12. Click on the OK button.
    13. These steps have now added the Ownership Details: Owner and Ownership Percentage data classes and the Asset User Owner association.

For Cost Centers (highlighted in blue):

  • Add and assign the data class mapping of Cost Center Ownership, which includes the Owner and Ownership Percentage. Tip: The Ownership Percentage must be provided and cannot be blank (null). This can either be done via the data file or manually in the Import Rule by setting the Source to <Value> = 100.
  • Add and assign the association mapping of Cost Center.
  • NOTE - to remove all Cost Center Associations, choose <Clear> as the Cost Center associations Lookup Key before Importing a new Cost Center association.
  • To add these:

    1. Click on "Select data classes".
    2. Click on the Group drop down list to expand it.
    3. Click on the CMDB Data Classes parent folder. Tip: This works like the above instruction's steps 3 and 9.
    4. Click on Cost Center Ownership.
    5. Click on the ">" button to add Cost Center Ownership to the "Selected items" list.
    6. Click on the OK button.
    7. Click on "Select associations".
    8. Click on the Group drop down list to expand it.
    9. Click on the "CMDB Association Types" parent folder. Tip: This works like the above instruction's steps 3 and 9.
    10. Click on Cost Center.
    11. Click on the ">" button to add Cost Center to the "Selected items" list.
    12. Click on the OK button.
    13. These steps have now added the Cost Center Ownership: Owner and Ownership Percentage data classes and the Cost Center association.

Notes: (1) An import rule for a specific resource type, such as computers or users, does not create associationed resources, such as cost centers, when the import rules. The associations (and foreign keys) must already exist otherwise the association will be skipped during the import. For example, if "ComputerA" is being inmported as a computer, and it is set to be associated to "New York Cost Center", if New York Cost Center does not already exist in Cost Centers, this association cannot work and will be skipped. The associations can be created by any means available to the customer, such as a different import rule for cost centers specifically.

(2) If the resource type does not include the expected data classes and associations, such as if a custom resource is used and it was not based off of a resource that has these (such as just "Resource" for the base type), these may not appear and the user may need to manually add them to the custom resource type before they can then be referenced in an Import Rule.

CMDB Rules: Removing Associations

CMDB rules cannot remove completely certain associations such as the the Asset Owner or Cost Center. This is because the data classes involved must be set to a valid value and cannot be empty. The workaround to this is to use a Data Connector import rule to clear the data classes involved and also their related associations. If this is not desired, a SQL script can also be used to do this. An example of how to do this with removing Asset Owners from computer resources is provided as an attachment to this article.

Additional Information

Data Connector Import Rule fails to set a foreign key correctly
156751

Troubleshooting import issues when using a Data Connector Import Rule
156966

Creating locations and automatically assign them to computers or users
181507

Create a CMDB rule to automatically assign locations to computers or users
181509

Create a Data Connector import rule to automatically assign computers or users to locations
181511

Attachments

Remove computer's asset owner association.sql get_app