Options for Handling Inventory Notes and Custom Fields

The import Web UI and REST interface enable you to specify whether the values for “notes” fields and custom fields defined for an inventory item in the import data file should overwrite or be appended to the values for these same fields defined for the identical inventory item in the target project. (For a description of identical inventory items, see Handling of Identical Inventory During a Project Import.)

The “notes” fields include the following:

Notices Text 
Audit Notes 
Usage Guidance 
Remediation Notes 

Note:For a custom field to be imported for an inventory item, the label of the custom field in the import data file must match the label of a custom field for the target inventory item.

For more details about this option to overwrite target inventory notes, see the following topics:

“Inventory Notes Handling” Options in the Web UI
“overwriteInventoryNotes” Attribute in the REST Interface

“Inventory Notes Handling” Options in the Web UI

Select the appropriate Inventory Notes Handling option on the Import Project dialog to configure whether the values for “notes” fields and custom fields are overwritten in target inventory during the import. For a description of this option, see Import Project Data Dialog. For complete instructions on using the Web UI to import project data, see Importing Project Data Using the Web UI.

“overwriteInventoryNotes” Attribute in the REST Interface

The option to overwrite target inventory “notes” and custom fields is available as the overwriteInventoryNotes attribute in the Import Project Data REST API. The following sections provide attribute details:

About the “overwriteInventoryNotes” Attribute
Example “overwriteInventoryNotes” Syntax in the Import cURL Command

About the “overwriteInventoryNotes” Attribute

To overwrite the value of each “notes” field or custom field in the target inventory item with the value of the corresponding field for the inventory item in the import data file, explicitly include the overwriteInventoryNotes attribute and set it to true in the cURL command that calls the import REST endpoint. Note that, if the data for a given field is blank in the import data file, no overwrite occurs; any existing value for the field in the target inventory is retained.

To append the value of each “notes” or custom field in the import data file to the value of the same field in the target inventory item, explicitly include the overwriteInventoryNotes attribute and set it to false (or omit the attribute entirely). The appended value is separated from the existing value with a line break and the following heading:

Copied during import from <ProjectName>:<InventoryName> (TimeStamp

However, If the value for any of these fields is the same for the inventory item in both the import data file and the target inventory, no value is appended.

Example “overwriteInventoryNotes” Syntax in the Import cURL Command

The following example shows the attribute explicitly included in the cURL command that calls the import REST endpoint:

curl -H "Authorization:Bearer %jwt%" -F importFile=@"FileToImport.zip" -F projectImportModel={ "createEmptyInventory” : true, “overwriteInventoryNotes” : false, “addFilesToInventory” : true, “inventoryFileMatchingCriteria” : “MD5_AND_PARTIAL_FILEPATH”, “inventoryDirectoryDepth” : 2, “markFilesAsReviewed” : true, “reviewFileMatchingCriteria” : “PARTIAL_FILEPATH”, “reviewDirectoryDepth” : 2, "resetInventoryUsage": false" };type=application/json http://hostname:8888/codeinsight/api/projects/{projectId}/import

For complete instructions about using the cURL command to execute an import, see Importing Project Data Using the REST API.

For more details about the implementation of the Import Project Data REST API, access the Code Insight Swagger documentation. To do so, click the icon in the upper right corner of the Code Insight Web UI, select Help, and click the REST API Guide link.