Assign roles to contract EAV - Import of data from CSV

Prepare CSV file

Here is an example of CSV file which can be used for import role definitions.

Username;Role;Position
kopr;Back Office;Business
svanda;Manager;Trip Advisor

CSV file can have optional number of columns, role and automatic role definitions columns are specified in setup of LRT. If you want to assign role to all user contracts, let the contract eav value in csv empty.

Create new LongRunningTask

Now we will create the new LongRunningTask(LRT). As shown in the picture, go to Settings → Task scheduler → Scheduled tasks and hit green "Add" button to add new LRT.

Fill all attributes

Now we need to create new LRT with these attributes:

  • Task type - ImportCSVUserContractRolesTask
  • Import csv file - dropzone to select or drop csv file
  • Column with username - name of the column with username
  • Column with roles - Name of the column with roles in csv file
  • Column with contract eav - Name of the column with contract eav in csv file
  • Contract eav name - Name of the contract eav in IdM
  • Column separator - separator of columns in csv file

Run the task

Now we just need to hit run.

And we also need to process it in all tasks.

You can check status about created role definitions in "all tasks" panel in task detail. Here you can find information about created or already existing automatic role definitions.

Everything should be set up so far and when the task ends, roles which was in IdM are assigned to contract with eav value same as in CSV.

Known issues

If you delete or upload new file via dropzone, you should delete old files, created from previous uploads.