Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

User Import with attributes

Robert Egan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 2, 2021

I want to import approximately 350 users into crowd with CSV files.

The problem is, I also have a custom attribute associated with each user.

Originally, I had intended to just use the CSV import process, and then add the attribute using SQL.

HOWEVER, I have no idea how to generate the ID because it is NOT a SQL Sequence, it is a Hibernate value generated by com.atlassian.hibernate.extras.ResettableTableHiLoGenerator.

Any recommendations? seq_userimport perhaps?

2 answers

2 votes
Maarten Cautreels
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2021

Hi Robert,

I usually try to avoid messing with the database as much as possible as this could screw things up pretty bad. When I'm doing bulk stuff in Crowd, I often use the REST api in combination with Postman runners.

For adding an attribute you could use a POST call to /rest/usermanagement/1/user/attribute?username={username} and add the attribute info to the body of that request:

{ "attributes": [ { "name": "invalidPasswordAttempts", "values": [ "0" ] }, { "name": "requiresPasswordChange", "values": [ "false" ] } ] }

Using Postman Runner you can use a csv as input and easily add attributes for hunderds of users.

Hope this helps.

Best,

Maarten

Robert Egan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 5, 2021

Regrettably, the way our environment is configured prevents me from using the Crowd REST API. I do not control the configuration, InfoSec does.

Craig Castle-Mead
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 13, 2021

Hey Robert,

Maarten's suggestion is definitely the approach I'd take, however if infosec have blocked REST API, then this isn't an option.

I doubt infosec would be very happy with direct DB changes if they don't even like you using the API. Maybe worth discussing with infosec if you can get a temporary exemption while you setup the accounts?

Otherwise, you might be able to automate the attribute population via a record/playback tool - something like Microsoft Power Automate Desktop or Selenium and automate the steps you'd be doing manually


CCM

0 votes
Robert Egan April 20, 2023

For the record, I generated SQL INSERT statements with the ID being MAX(ID)+1.

This worked in theory (the SQL executed without errors) but it broke the applications Add User feature. I assume the built in counter collided with my numbers, which seems reasonable.

However, since the built in counter only INCREMENTS, I was able to add my attributes using MIN(ID) -1. And that seems to have worked, at least so far.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
4.0.2
TAGS
AUG Leaders

Atlassian Community Events