How to change the author of a comment in Jira
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Direct database modifications are not supported by Atlassian. Always back up Jira's database before performing any modification to it.
If you need to change the author of a Jira comment, the only way possible is to modify the jiraaction
table in the database where the comments are stored.
Environment
Applicable to all versions of Jire Core and Software 7.x/8.x and Jira Service Management 3.x and 4x.
Solution
Please test these steps in your staging environment before performing the changes in production
There are five steps needed to change the comment authors:
Shutdown Jira
Identifying the
issueid
of the issue that needs to be changedIdentifying the
ID
of both usersUpdating the
jiraaction
table and changing the authorStart Jira
We will work through the following example where we want to change the comment author from "clevine" to "thor".
The first query is simply to get the issue id:
1
SELECT I.id FROM jiraissue AS I JOIN project AS P ON P.id = I.project WHERE P.pkey = 'GOT' AND I.issuenum = 1;
Result:
id |
10000 |
Next, we need to get the ID of both users, we can query the cwd_user
table for the two users with a similar query:
1
select AU.* from cwd_user CU join app_user AU on AU.lower_user_name = CU.lower_user_name where user_name in ('clevine','thor');
Result:
id | user_key | lower_user_name |
10000 | JiraUSER10000 | clevine |
10100 | JiraUSER10100 | thor |
With this, we can then modify the jiraaction
table.
The author format in the jiraaction
table is the user_key, with an example being JiraUSER10000.
Our next would then be to change the author from clevine to thor with the following query:
1
update jiraaction set author = 'JiraUSER10100' where author = 'JiraUSER10000' and actiontype = 'comment' and issueid = 10000;
Once this query has been run, please start Jira and confirm the expected changes are present.
Was this helpful?