Add a list of users to groups from a CSV file

This script will add a list of users to user groups in Confluence.

//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

user,group
johnDoe,conflunce-users
janeDoe,confluence-users
jSmith,confluence-administrators


See Other Recipes

See More Documentation