Skip to end of banner
Go to start of banner

How to Add Users to Groups in Bulk

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Description

If you have large numbers of users that need to be added to groups, the CLI can be used to automate that procedure using the addUserToGroup action. In many cases, you might have definition of what users need to be added to what groups in a CSV file, the result of a SQL query, or just a plain text list in one form or the other. For example, this Confluence KB article describes a way of producing this type of information from a Confluence or Crowd directory.

The CLI has various built in actions for bulk operations like this that makes it easy to run a single action to import bulk data. Choice the method that works best for you based on the source of your data. See Reference for more details on the following actions:

  • run
  • runFromCsv
  • runFromSql

AddUserToGroup

This base action is pretty simple: it requires a userId and group. There are some options to consider using as well:

  • autoGroup - automatically creates a group if the group specified does not exist.
  • preserveCase - by default and as a best practice, userIds (also referred to as usernames in Confluence) are lowercased. Use this option to preserve the cased if that is your standard.
  • continue - use this option to ignore cases where the userId is already in the group. This normally should be use for bulk operations.

Example - RunFromCsv

We will use runFromCsv as an example, but similar techniques can be used for the other cases.

example.csv
"userId", "group"
admin, jira-administrators
admin, jira-developers
admin, jira-users


Action
--action runFromCsv --file example.csv --continue --common "--action addUserToGroup --autoGroup --continue"


  • No labels