Remove some users from group and projects

sunesh June 12, 2012

Hello,

Can someone help me with the steps to remove some users from all the group and projects in JIRA using SQL statements. we are having JIRA 4.4.1 version and using sql server 2008 db.

appriciate your help

Sunesh

7 answers

3 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2012

Er, don't.

If you try to remove them with SQL, you'll need Jira offline while it's running, a re-index afterwards, you're open ot unexpected problems and data corruption, and you will have to back up properly and test the backup before you do this.

On the SQL side, I can name 8 tables you'll need to worry about (2 of which are not simple "remove/blank data" actions) without resorting to notes which I think tell me there's something like 17 tables to check and amend.

Rather than jump at a solution, could you tell us what you're actually trying to do, and why the UI isn't appropriate?

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2012

That's a lot more simple. I think the table you need is cwd_membership.

If you're going to execute SQL updates of any kind on a Jira system, then the procedure is:

  1. Stop Jira
  2. Take a backup of the database
  3. Prove the backup works by restoring it to a test system
  4. Run the SQL
  5. Restart Jira
  6. Normally, you'll need to re-index, but I don't think you'll need it for removing users from groups.
0 votes
Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2012

I think in all the time we had discussed this and all the time you need to make a backup, test it and so on, you could have easily deleted these 700 People with the User Interface ;-)

0 votes
sunesh June 13, 2012

ok, let's make it simple . right now I only need to remove these users from "Jira group" so that I can ban thier access to our jira site..

Thanks

Sunesh

0 votes
sunesh June 13, 2012

Hi Thompson,

Thanks for your reply. I have around 700 users to be removed which could be laborious task from the UI.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2012

SQL is still a really bad way to approach this and it's pretty certain that you'll break something, unless you spend weeks getting your scripts exactly right.

You must already have the list of users to remove if you were thinking of using SQL, so you should take that and convert it to Jelly (this is easy with a spreadsheet or script) and run that instead. Jelly uses the internal API to do the work, so it won't break anything and doesn't need downtime.

See https://confluence.atlassian.com/display/JIRA/Jelly+Tags#JellyTags-jiraRemoveUser

0 votes
Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2012

Hi Sunesh,

why don't you want to use the user interface ? I wouldn't do that directly on the database without a really good reason...

Best regards

Thomas

Suggest an answer

Log in or Sign up to answer