24-May-12
Hi,
We're running JIRA v5.0. We copied our production JIRA to development. On our development JIRA, we deleted all projects, groups (with the exception of the JIRA groups), and the users by running a SQL statement against the CWD_USER table. When I logged into our development JIRA, I notice there are over 800 users still listed. All these users are in the 'JIRA Internal Directory'. Please note that since we deleted all projects and groups, there are no dependencies with the remaining users. Even if there were, we want to delete them all.
My question is: is there a special table users in the 'JIRA Internal Directory' are located in? If so, please let me know so we can run a query to delete them. Also, if there is a separate table for those users, why is that? I would presume all users would be in the CWD_USER table.
Thanks!
It would be safer to use JIRA Command Line Interface removeUser action. Use runFromSql to do it in bulk. Doing database actions directly is error prone and you need to understand all the application's database structure. The dangers of doing direct database actions have been commented on numerously on this site.
your J CLI tool really needs some more documentation as I have no idea what I am supposed to do with the files once they are on my computer. Examples in the documentation would have been really helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know its pretty old ... but just in case anyone else is looking for an easy solution here it is ... :)
import requests
import json
import csv
import getpass
user = raw_input("Username? ")
password = getpass.getpass("Password? ")
from requests.auth import HTTPBasicAuth
url = "%%SITEADDRESS HERE%%/rest/api/2/user/search?username=bk.ru&maxResults=545"
r = requests.get(url,auth=HTTPBasicAuth(user,password))
for x in range (0,len(r)):
user = (r[x]['key'])
urlx = "%%SITEADDRESS HERE%%rest/api/2/user?username="+str(user)
print (str(x)+urlx)
r = requests.delete(urlx,auth=HTTPBasicAuth(user,password))
if(r.status_code == 204):
print (str(x)+str(user)+"Deleted")
else:
print (r.status_code)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian does not recommend making direct changes to the JIRA database.
Our recommendation would be to either use Bob Swift's CLI, as per his comment, or alternatively, writing a script and using the JIRA REST API:
The feature request raised for bulk user delete operations in JIRA is https://jira.atlassian.com/browse/JRA-8047, and you may vote on it to increase its visibility with our developers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.