Possible to set comment author through REST API?

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

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.

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.

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

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

64 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you