DataImporter - Import CI Linked to Planned Requests

SHOW ALL CONTENT

Table of contents

Overview

This article presents the method to import CIs associated to planned requests. 

See the DataImporter- Import Planned Requests article to find out how to import planned requests.

References

 

What you need to know:

The reference template files (.xlsx et .xml) to prepare imports are included in the PlannedRequests.zip file.

Required Fields

  • PlannedRequest - Numeric
    • Must contain the number of the planned request that will be assigned to the CI
  • CI - Text
    • Must contain a valid CI name

Optional Fields

  • Note - Text (5000)
    • This note will be added in the planned request when CI gets assigned.
    • This field is replaced by imported data upon each import. The program does not add information, but replaces it.
  • LastRequestCompletionDate - Date
    • This field is used to specify the last date on which the planned request was completed for this specific CI.
    • Invalid if a date is already assigned.
  • NextRequestPlannedDate - Date
    • Valid only if the associated planned request is in the IndividualRequestPerCI mode.
    • Invalid if the associated planned request is in the Variable interval mode and VariableIntervalAfter is Completion.
  • IsActive - Boolean
    • Indicates if the associated request for this CI is active or not.
    • Accepted values are: 1 or 0, True or False, Yes or No.
    • By default, assignment of CI will be considered as active.

Configuration File (XML)

The declaration of the source is done by indicating the PlannedRequestItem value in the <Content> tag.

NOTE: The XML file used as this example is for an import done from Excel 2007 or 2010.
<?xml version="1.0" encoding="utf-8" ?> 
<Sources>
    <Source Name="ImportPRCI">
<ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\Import\PlannedRequests.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";</ConnectionString>
<ViewName>[Import PR_CI$]</ViewName<Content>PlannedRequestItem</Content>

<!-- Additinnal tags -->    
<CIIdentificationMethod>CIByName</CIIdentificationMethod>
<EmptyValueHandling>NoChange</EmptyValueHandling>
    </Source>
</Sources>

See the XMLConfiguration File article that explains how to program your tags. 

Information on Additional Tags

To import CI of planned requests, the XML file can contain 2 additional tags. These tags are not mandatory and if they are not specified, the default values will be used.

What you need to know:

The additional tags are case sensitive.

If the value is not written exactly the way it is documented, Octopus will ignore the tag and use to the default value. 

CI Identification Method

In the XML file to import CI of planned requests, it is possible to specify how the CI will be found and updated. This value becomes the unique key to the import. If this tag is not specified, the default value will be the CI name.

Permitted values for the IdentificationMethod tag: 

  • CIByName (Default value): CI name
  • CIByInventoryNumber: Inventory number
  • CIBySerialNumber: Serial number

To use this tag, add the following line to the XML file:

<IdentificationMethod>VALUE</IdentificationMethod>

Management of Empty Fields

DataImporter can help clean the data contained in Octopus when empty fields are encountered. If this tag is not present, the NoChange default value will be used. 

If you want to use this tag as part of an import, it is important that your data source only contain columns to act on. DataImporter will systematically try to clean all these columns. You can clean all fields except:

  • Required fields
  • Fields that have been configured as mandatory in the Octopus database
  • Fields that accept only specific values, for example boolean type fields (yes/no).


Permitted values for the EmptyValueHandling: tag

  • Clear: The existing value in Octopus will be cleared and the field will be empty
  • NoChange (Default Value): Fields that are empty in the data source being imported will be ignored and the existing value in Octopus will be kept

To use this tag, add the following line to the XML file : 

<EmptyValueHandling>VALUE</EmptyValueHandling>
X
Help us improve our articles








Help us improve our articles