Script to add users to the group

Sandra Priedīte March 5, 2020

Hello,

I need to add 100 users to a group in Confluence.

Tried to find the script, which could do that, but no success.

Would appreciate a help or guidance (where to look).

Thanks!

1 answer

0 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 6, 2020

Whenever I've done this, I've used Confluence CLI to create a bash script.

Here's an example script:

## Copy https://marketplace.atlassian.com/download/plugins/org.swift.confluence.cli/version/22 to `~/src/bob-swift/confluence-cli-2.6.0`
##
## Open `~/src/bob-swift/confluence-cli-2.6.0/confluence.sh` & swap out the following line
##
## > java -jar `dirname $0`/lib/confluence-cli-2.6.0.jar "$@"
## for...
## > java -jar `dirname $0`/lib/confluence-cli-2.6.0.jar --server http://localhost:1990/confluence --user admin --password admin "$@"
##

confluence=~/src/bob-swift/confluence-cli-2.6.0/confluence.sh

$confluence --action addUserToGroup --userId "user1" --group "my-group"
$confluence --action addUserToGroup --userId "user2" --group "my-group"
$confluence --action addUserToGroup --userId "user3" --group "my-group"
$confluence --action addUserToGroup --userId "user4" --group "my-group"
$confluence --action addUserToGroup --userId "user5" --group "my-group"
$confluence --action addUserToGroup --userId "user6" --group "my-group"

You might need a newer version of the app though. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events