Bulk add or remove Jira users with ACLI

Bulk add or remove Jira users with ACLI

This guide explains how to use ACLI to bulk add or remove users in Jira. These commands are especially useful when testing migration scenarios, such as Data Center (DC) to Cloud migrations. In these cases, users are typically added to the Cloud instance during migration, so bulk adding on Cloud is often skipped.

Bulk add users in Jira Data Center

  1. Create a CSV file
    Format the file as follows:

    "userId","userEmail" "User-1","atest@examplegear.com" "User-2","btest@examplegear.com"

    You can use tools like ChatGPT to quickly generate CSV content for test users.

  2. Run the bulk add command

    Use the runFromCsv action with the addUser command:

    ./acli jira --action runFromCsv --file addUsers.csv \ --common "--action addUser" \ --server http://dockersupphost2.bobfire.com:8220 \ --user <username> --password <password>
  3. Optional: Add users to a group
    Including the group parameter when adding users makes it easier to bulk remove them later. You can use getUserList to retrieve users by group.

    Example:

    ./acli jira --action getUserList --group "clone-group1" \ --server http://dockersupphost2.bobfire.com:8220 \ --user <username> --password <password>

Bulk remove users in Jira Data Center

To remove users previously added to a group:

./acli jira --action runFromUserList --group "clone-group1" \ --common "-a removeUser --userId \"@userId@\"" \ --server http://dockersupphost2.bobfire.com:8220 \ --user <username> --password <password> --continue

Bulk remove users in Jira Cloud

You can run the same runFromUserList command on your Cloud instance:

./acli jira --action runFromUserList --group "clone-group1" \ --common "-a removeUser --userId \"@userId@\"" \ --server <Base URL> --user <email id> --token <token>

This command may not work for users with duplicate display names (Full Name). Always verify user removals in the User Management section of your Jira site.

Alternative method for Jira Cloud: Using user keys

If the group-based removal fails, use user keys instead:

  1. Get the list of user keys

    Run the following command to retrieve users and their keys:

    ./acli jira --action getUserList --group "clone-group1" \ --server <Base URL> --user <email id> --token <token>
  2. Create a CSV file with user keys

    Format your CSV like this:

    userId 712020:0053ffd1-14fd-4cf9-be15-5d1976314a1e 712020:2272f007-ead3-4667-9d44-fa2f14506f66
  3. Run the bulk delete command

    ./acli jira --action runFromCsv --file bulkdelete.csv \ --common "-a removeUser" \ --server <Base URL> --user <email id> --token <token>