Delete user from database in Jira server

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


この記事はアトラシアンのサーバー製品にのみ適用されます。クラウドとサーバー製品の違いについてはこちらをご確認ください。

データベースの変更を行う場合は必ず事前にバックアップを取得してください。

問題

It is not possible to delete a user from JIRA because the user is associated with several issues. 

原因

The user might be a reporter, assignee or commented on several issue so JIRA will not allow you to delete the user until you have removed all the user's associations.

回避策

It is possible, but not recommended, to forcefully delete this user from the Database without removing the user from the associated issues

データベースの変更を行う場合は必ず事前にバックアップを取得してください。

  1. Stop JIRA. Open the database and run the following :

  2. Run this SQL

    select * from cwd_user where user_name = 'xxxxx';
    select * from app_user where lower_user_name in (select lower_user_name from cwd_user where user_name = 'xxxxx');

    Replace xxxxx with the affected username. Case sensitive!

  3. Please take note of the *id* values of this user in both tables for step 4. The queries might return multiple rows if there are multiple directories with associated with the user, so you might need to take note of multiple ids.

  4. Run this SQL to delete the cwd_user_attributes of the user

    delete from cwd_user_attributes where user_id='xxxxx';

    (i) Replace xxxxx with the *id* from step 1&2

  5. Run this SQL to delete the cwd_membership of the user

    delete from cwd_membership where child_name='xxxxx';

    (i) Replace xxxxx with the affected username


  6. Run this SQL to delete the cwd_user of the user

    delete from cwd_user where user_name ='xxxxx';

    (i) Replace xxxxx with the affected username

  7. Run this SQL to delete the user from app_user

    delete from app_user where id ='xxxxx';

    (i) Replace xxxxx with the id from step 2 that you got for the app_user table


  8. Jira を起動します。

This will remove the username from all 4 tables :

  • cwd_user_attributes
  • cwd_user
  • cwd_membership
  • app_user


And therefore , removing the user completely from the JIRA Internal Directory. Please remember to restart JIRA after performing the changes from the database

説明 It is possible, but not recommended, to forcefully delete this user from the Database without removing the user from the associated issues
製品Jira
プラットフォームサーバー
最終更新日 2019 年 9 月 25 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.