Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Possible to set comment author through REST API?

Linaro IT Services January 20, 2015

I'm writing a script to migrate tickets into JIRA from another platform. I'm trying to keep as much information as possible and that includes who wrote each comment on an issue.

I've tried specifying the author information when I create the issue but it seems to be silently ignored.

Is there a way to set the author?

 

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Andreas Ebert
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 20, 2015

I'm guessing your using POST /rest/api/2/issue/{issueIdOrKey}/comment?expand to add the comments. And indead, with this REST resource it's not possible to set the author. It will always be the logged-in user. Which makes sense, because any user can use JIRA's REST API and it therefore would be a bad idea to allow setting the comment author.

You might have more luck with other importing methods.

Philip Colmer
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 20, 2015

Although I suppose the API could do some permissions check and allow an Administrator or Systems Administrator account to set these values. I'm therefore assuming/guessing that the import tools bypass the API and perform some direct DB changes. Which is a shame because I need a Zendesk import tool now (well, within the next few weeks) and the likelihood of Atlassian producing that based on the low number of votes for one ... yeah, 'nuff said. Oh well, I'll just have to embed the commenter's name at the start of the comment. Ugly but at least it retains the history.

Like Deleted user likes this
Andreas Ebert
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 28, 2015

Glad to have been of help. Please consider accepting my answer by checking the tick mark.

Deleted user June 3, 2019

is there been any updates on this topic on latest jira version (after 2016) to change the author name from authenticated account? 
Thanks

Like # people like this
0 votes
Francisco Mancardi April 11, 2015

When trying to integrate different tools, as happens on TestLink (www.testlink.org) to allow users to create issues on JIRA when doing test case execution, people always want to have item created on JIRA with right author, in this situation user that is executing the test case.

Current TestLink implementation uses (and this may be can be/ has to be changed?) a single service user defined on JIRA with appropriate rights to do operation via API. (user & password is saved on testlink configuration for specific JIRA instance/project)

Giving appropriate rights to this service user, allowed me, to be able to set issue reporter when creating it.

IMHO it would be great if same principle (as was explained by Phillip Colmer) where available also when adding a comment.

best regards

 

Francisco Mancardi

TestLink Team Leader

TAGS
AUG Leaders

Atlassian Community Events