How to change the name of commentator via API ?

Suresh Kumar January 5, 2017

How to change the name of commentator via API ? 

3 answers

1 accepted

1 vote
Answer accepted
Volodymyr Krupach
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 5, 2017

You should be able to pass 'author' JSON property when adding/updating comment. Please check the doc: https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-addComment

Leaving it empty defaults to REST API user.

Please check the comments.

Suresh Kumar January 5, 2017

It respond me this error 

Can not deserialize instance of com.atlassian.jira.issue.fields.rest.json.beans.CommentJsonBean


and im adding this array to json 

 

Ex

$res_c = array(array('author'=>array("name"=>"fred","displayName"=>"Fred F.User","active"=> false),'body'=>'mmyyyyyyyyyy'));


Volodymyr Krupach
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 5, 2017

The author REST piece should be in form:

"author": {
  "name": "fred"
}
Suresh Kumar January 5, 2017
This is json format im setting in api call still no success :(
{"author":{"name":"fred"},"body":"lots of testing"}
Volodymyr Krupach
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 5, 2017

No success in terms that the author is not changed or there is an error?

Suresh Kumar January 5, 2017

No author change . Comments are added with the name of admin.

Volodymyr Krupach
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 5, 2017

No luck sad. So it's hard-coded to put current REST user and author is ignored despite it's in the docs. I knew that there is such hard-code for REST worklogs now we booth know that the same is for comments.

0 votes
Suresh Kumar January 5, 2017

Basically i have list of issues with comments that i imported from basecamp in json format . Now i want to create issue with comments in JIRA with API. The problem is that  i have different people's comments on issue while JIRA is only showing comments with name of Administrator  . So how could i change the name of commentator via api?

0 votes
Volodymyr Krupach
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 5, 2017

There is no such field or role as commentator in JIRA. Please adjust your question by explaining what you have and what do you want to do.

Suggest an answer

Log in or Sign up to answer