Import a LinkedSet
What is a linkedset?
It is an attribute that represents a list of related objects. It is displayed as a tab in the details of the object. There are two types of LinkedSet:
Deviceson a Location : a Device is located in a single location
Members(Person) of a Team : a Person can belong to multiple Teams
Only n:n linkedset can be imported. You cannot import the related objects themselves, they must exist in iTop already.
Example: UserLocal has the attribute profile_list. This represents the list of profiles attached to an object UserLocal, by the mean of the class lnkUserProfile
When can I import link sets?
All of the data input features do provide you with the capability to specify a link set:
Example: importing users
Example for importing allowed organizations and profiles at the same time as importing the users. Those 2 attributes are many-to-many relationships:
Let's imagine that I want to allow 3 organisations to the same user.
Each of the Organizations in the source file can be identified by their id, name or code.
The fields which are expected when loading a
AttributeLinkedSetIndirectlike Allowed Organizations, are those of the n:n relation class, (here
URP_UserOrg), which means that you could only provide
But in general, with n:n relationships, what you know about the remote object, are some of its fields values but maybe not its iTop id. In this case, you can specify a code from the remote object and there is a special syntax for this:
ExternalKey in the relation class, pointing to the remote object (eg. allowed_org_id)
a dash caracter followed by a superior: ->
code of the remote attribute (eg. name)
the value to retrieve the remote object (eg. Demo)
a pipe, to separate 2 remote objects, needing to be linked to the same user
and again the 5 first bullets above
like this “allowed_org_id->name:Demo|allowed_org_id->code:IT”
allowed_org_id->id:4 does not work!
In this example, I am combining different means to identify organizations in a many to many relationship, for the same user, that works, also you probably won't use it every day.
Person->Email,Login,Language,Password,Profiles,Allowed Organizations "firstname.lastname@example.org","portal","EN US",1234,"profileid->name:Portal user","allowed_org_id->code:IT|allowed_org_id->name:Demo|allowed_org_id:1"
Let's take an example. I would like to specify a list of profiles for a user and for each profile specify the reason why he should have it. The reason is a field of the many-to-many relationship.
First, attach one single profile:
Profiles are attached by the mean of the class URP_UserProfile→profileid. Here I have specified that the attribute name of the class URP_Profile must match 'Configuration Manager'.
Now, I want to keep track of the reason why this person has this profile:
profileid->name:Configuration Manager;reason:operations manager
Finally, I need to give another role to the same login:
profileid->name:Configuration Manager;reason:operations manager|profileid->name:Change Supervisor
Each and every link is specified independently for the others.
Each new link specification must be preceded by '|'.
Now I would like to specify a reason, but I need to use a character that is understood as being a separator:
profileid->name:Configuration Manager;reason:operations manager|profileid->name:Change Supervisor;'reason:manager ;-)'
The whole attribute specification can be surrounded by quotes.
Limitations / Known issues
org_name) cannot be used as reconciliation keys
org_namecan be replaced by
->) cannot be used mutiple times
virtualhost_id->org_id->nameis not supported.
In the configuration file, you can change the following:
separator between two items in the list: link_set_item_separator
separator between two attributes: link_set_attribute_separator
separator between the attribute name and the value: link_set_value_separator
qualifier for the whole attribute: link_set_attribute_qualifier