We had a little issue with an old FishEye server that was running in two instances with the same database. (Clone for test instance was misconfigured)
This caused that the same smart commits repeatedly triggered creation of comments in Jira Issues before we noticed the problem. We were able to narrow down the comments in the database table by user and time frame and identified more than 23k were created within 48 hours.
Now we are looking for the best way to delete those comments without causing any database inconsistencies. Is there any option via UI or API to delete the comments in bulk?
Is this something we should remove directly in the database.
I noticed the comments are stored in the table JIRAACTION and the comments are referenced as well in table COMMENT_VERSION. Is there any other tables that can contain references? Is it fine to shut down the server remove the faulty comments and restart the it?
Hi @Sebastian G
If you have scriptrunner you can write a scriptconsole to remove those comments.
@Florian Bonniec: Thanks for the quick reply.
Unfortunately, we do not have the ScriptRunner plugin and we may have used the plugins free trial before and won't be able to install it without paying the full price which is no option.
What I might be able to do is to export the comment ids and issue keys from our database and than use POSTMAN as BatchRunner and run against the REST API https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-id-delete .
That just might be painfully slow compared to two database delete statements.
You can try to delete in the db directly in a staging env, but it's always cleaner to use the UI or the API.
You can write a python script instead of using Postman.
Make sure to use the correct API, not the cloud one.
I usually prefer doing it through the app as the app will clean whatever it has to clean. Doing it in the db directly is a risk to forgot something and can lead to issues later.
If you want to do it in the db, try it in a test environment first, then load 1 issues impacted to see if there is any error.