DataImporter - Import departments

SHOW ALL CONTENT

Table of contents

Overview

This article explains how to import departments in Octopus.

References

 

 

What you need to know:

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

Required Fields

  • Name - Text (100)
    • Represents the department name.
    • This field will be mandatory when importing departments if the identification is based on the name.
  • Number - Text (100)
    • Represents the department number.
    • This field will be mandatory when importing departments if the identification is based on the number.

Optional Fields

  • Manager – Text (100)
    • Represent the department manager.
    • The user must already exist in Octopus and be uniquely identifiable for this section to work. 
    • The identification method of the mananger is defined with the ManagerIdentificationMethod tag.
  • ParentDepartment - Text (100)
    • Represents the parent department of a specified sub-department. 
    • The parent department must be specified with the same idenfitication method. (By name or number).
  • CostCenter  - Text (50)
    • Free text field to allocate a cost center to the department.
    • The cost center field will only be available if the cost center mode has been activated in Octopus.

Configuration File (XML)

The indication of the source is done by indicating the Department value in the <Content> tag.

NOTE: The XML file used in this example is for an import done from Excel 2007 or 2010.

 

<?xml version="1.0" encoding="utf-8" ?> 
<Sources>
<Source Name="ImportDepartment">
<ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Import\Departments.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";</ConnectionString>
<ViewName>[Import Departments$]</ViewName<Content>Department</Content
<DepartmentIdentificationMethod>DepartmentByName</DepartmentIdentificationMethod>
<ManagerIdentificationMethod>UserByWindowsUsername</ManagerIdentificationMethod>
<EmptyValueHandling>NoChange</EmptyValueHandling>
</Source>
</Sources>

To explain the tags used in all types and to find out more about the types of files, please refer to the XML Configuration File article.

Information on Additional Tags

To import departments, the XML file can contain 3 additional tags. These tags are not mandatory and if they are not specified, the default values will be used.

Department identification method

In the XML file used to import departments, it is possible to specify how the departments and the parent departments are found.

Accepted values for the DepartmentIdentificationMethod tag are:

  • DepartmentByName (Default value): Uses the department name.
  • DepartmentByNumber: Uses the department number.

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

<DepartmentIdentificationMethod>VALUE</DepartmentIdentificationMethod>

Department manager Identification Method

It is possible to specify how the department manager will be found in the data source. If this tag is not specified, the default used value will be the Windows username. 

Accepted values for the tag MainContactIdentificationMethod are:

  • UserByExternalID : Unique Octopus external identifier of the manager.
  • UserByID : Manager employee number.
  • UserByName : First and last name of the manager (In the John Smith format).
  • UserByWindowsUsername (Default value) : Manager's Windows username. 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: 

<ManagerIdentificationMethod>VALUE</ManagerIdentificationMethod>

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 contains 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 emptied.
  • NoChange (Default Value): Fields that are empty in the data source being imported will be ignored and the existing values in Octopus will be kept.

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

  <EmptyValueHandling>VALUE</EmptyValueHandling>

Importing multiple levels

In order to import multiple levels, you need to specify the last level in the Name column and all parents levels into the ParentDepartment column.

To import the following structure: IT - Service Desk - Quebec you need to use the following values:

Name: Quebec

ParentDepartement: IT | Service Desk

The parent departments "IT" and "Service Desk" will be automatically created.

Please note that the only supported separator for this type of importation is |

WARNING :

It is not possible to change the structure of department using DataImporter. To change the Parent Department of a department, you will need to use the Windows client and manually move them (drag & drop).

 

X
Help us improve our articles








Help us improve our articles