This script will add a list of users to user groups in Confluence.
Code Block |
---|
language | java |
---|
linenumbers | true |
---|
|
//create struct to store csv data
struct row {
string userID;
string userGroup;
}
//get list from CSV
row [] rows = readFromCSVFile("users.csv", true); //adjust csv file name and path
//loop through users in list
for(row user in rows) {
//sample syntax - addUserToGroup(userNameOrKey, groupName)
addUserToGroup(user.userID, user.userGroup);
}
return "done"; |
Sample CSV file
Code Block |
---|
user,group
johnDoe,conflunce-users
janeDoe,confluence-users
jSmith,confluence-administrators |
See Other Recipes
Filter by label (Content by label) |
---|
showLabels | false |
---|
showSpace | false |
---|
cql | label = "users" |
---|
|
...