Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete a user with issue comments

Praveen
Contributor
June 20, 2018

Hi, I would like to know if it is possible to delete a user from Jira who has added comments to  issues.

I know that we can disable the user/remove access, but would like to know on how to permanently the user from the application.

 

2 answers

2 votes
Moses Thomas
Community Champion
June 20, 2018

@PraveenYou  can  use this  plugin https://marketplace.atlassian.com/apps/1214301/comment-toolbox-for-jira?hosting=server&tab=overview

Right now it not  possible on  application interface, but of course you  could  crack and do it from  database but not  advisable.

Advice

Don't delete users. Inactivate them. Deleting them can cause errors when JIRA tries to resolve any action they took in an issue. It stores the database id, not their name in issues.  What  i  would do is to  deactivate them,  remove all access group/roles, save the groups some which  they belong  to  some where in case they  return. access to  projects base on single user  of-course could be given  back  by project admin.

There is a ticket already registered in  Jira  https://jira.atlassian.com/browse/JRASERVER-34718

 

best!.

Grigory Salnikov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2018

Inactivating user should complete the task.

At first we wanted to do just the same but later on realized that inactivating is enough and do the trick.

I give an up to @Moses Thomas's advice.

Paul Cope December 12, 2024

Not possible for us. Under GDPR if a user request we delete all of his data which we do get then we are breaking the law as we cannot follow such instruction and are continuing to process such data.

Also this plugin, nice way to profit but we cannot afford such luxury.

If anyone knows how else we can search and delete a users comments so we can then delete the user, please let me know.

0 votes
Sana Safai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2018

If you have ScriptRunner or database access you can move those comments to another user and then remove that unwanted user.

Neeraj Malik September 4, 2019

please share the steps to do that

Ulrich Dreifke January 7, 2020

I am also interested to know how to move the comments. 

Sana Safai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2020

WARNING: No guarantee that this works or that it won't break your Jira.

Test this in your test environment first and backup your database before making any direct modification to your database.



import com.atlassian.jira.component.ComponentAccessor

import groovy.sql.Sqlimport org.ofbiz.core.entity.ConnectionFactory

import org.ofbiz.core.entity.DelegatorInterface

import java.sql.Connection


def delegator = (DelegatorInterface)

ComponentAccessor.getComponent(DelegatorInterface)

String helperName = delegator.getGroupHelperName("default")


def sqlStmt = """

UPDATE       "jiraaction"

SET author = 'newusername'

WHERE author = 'oldusername'

""" 
Connection conn = ConnectionFactory.getConnection(helperName);
Sql sql = new Sql(conn)
StringBuffer sb = new StringBuffer()
sql.eachRow(sqlStmt) {
    sb << "${it}\t\n"
}
sb.toString()
Sana Safai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2020

Also, the quotation marks may be erroneous, so if you just copy paste it may not work.

Suggest an answer

Log in or Sign up to answer