DataImporter - Import Relations Between Users and CI

SHOW ALL CONTENT

Table of contents

Overview

Importing the relationship between the users and the CI allows to add the users that use a CI. It is important to have previously added the users and the CI before doing this type of import.

References

 

What you need to know:

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

Required Fields

  • CI – Text (125)
    • Name of CI to be related
  • User

Configuration File (XML)

The declaration of the source is done by indicating the CIUser 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="ImportCIUsers">

<ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\Import\CI_EN.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";</ConnectionString>
<ViewName>[Import CI User$]</ViewName>
<Content>CIUser</Content>

<!-- Additional tags -->
<UserIdentificationMethod>UserByWindowsUsername</UserIdentificationMethod>
<ManageRelations>False</ManageRelations>

     </Source>
</Sources>

Refer to the XML Configuration File article that explains how to program references to the data sources.

Additional Tags to Import CI Users

To import CI users, the XML files used can contain additional tags. These tags are not mandatory and if they are not specified, the default value 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. 

User Identification Method

In the XML file to import the relationship between the users and CI, it is possible to specify how the user will be found. This value becomes the unique key to the import. If this tag is not specified, the default value will be the Windows username of the user.

Permitted values for the UserIdentificationMethod tag:

  • UserByID: User employee number
  • UserByName: First and last name of user (in the following format John Smith)
  • UserByWindowsUsername (Default value): Windows username of the user. In the data source, the format with more than one username is not accepted, like "sile01;esil18". Only one username must be used.

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

<UserIdentificationMethod>VALUE</UserIdentificationMethod>

Manage the Relationship Between Users and CIs

DataImporter can deactivate and reactivate the relationship between users and CIs, depending on their presence or absence in the data source. The removal or addition of the relationship is based on the elements present in the source.

The ManageRelations tag allows you to manage it automatically. If this tag is not specified, the default is False and therefore the option is not enabled.

How the option works:

  • When this option is enabled, it is essential to ensure that the name of the source; the Source Name in the XML file is always the same to manage these relationships.
    • For example <Source Name = "UserRelationshipManagement">.
    • It is important not to mix an import where you want to manage the relationships with another one, because if you do the import with the same source, but without the relationships, all relationships previously imported from this source will be removed.
  • When a user is no longer part of the data source, the system removes the relationship during the import.

Permitted values for the ManageRelations tag:

  • True: Will manage the relationship between users and CIs, whenever an import with the same source name is made.
  • False: Default value that will not take into account existing relationships between users and CIs.
     
What you need to know

If the ManageRelations tag is set to True, but that the list of User / CI relationship is empty, all active relationships previously imported from this source will be removed.

You must be very careful with this tag.

In Octopus, the Import Source column can be useful in this context to see the origin of the link between the user and the CI. If the value is empty, the link was created manually.

 

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

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








Help us improve our articles