How to remove all users from a group using the Jira Command Line Interface

This article explains how to remove all users from a Jira group using the Jira CLI.

Instructions

 

  1. Combine the runFromUserList and removeUserFromGroup actions.

  2. Enter the following Jira CLI action to remove all users from a group:

    jira --action runFromUserList --group <group_name> --common "-a removeUserFromGroup --userId @userId@ --group <group_name>"
  3. Replace <group_name> with the name of the group you want to remove all users from.
    For example, if you want to remove all users from a group named "developers," the command is:

    jira --action runFromUserList --group developers --common "-a removeUserFromGroup --userId @userId@ --group developers"
  4. Select Enter to run the command.

  5. The Jira CLI processes the action and removes all users from the specified group.

  6. Verify that all users have been removed from the group.

Additional Information

This method works for removing users from any group in Jira, provided you have the necessary permissions.

You can use a similar method with Confluence CLI to remove users from Confluence groups. Apply the syntax described above within the Confluence CLI environment.

Make sure to use this command with caution. Removing users from groups in Jira can impact their access and permissions.

It is recommended to test in a non-production environment or run the action with the --simulate parameter to verify behavior before deploying.