Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,361,980
Community Members
 
Community Events
168
Community Groups

Jira API to tag user in Comment

Hi 
I am able to add comment to issue in Jira through API  but i am struggling to mention/tag user in that comment i am using below API 

curl -D- -u admin:adminxyz-X POST --data '{"body": {"type": "mention","attrs": { "id": "xyz","text": "hi @XYZ "}}}' -H "Content-type: application/json" https://myjira-prod.com/rest/api/2/issue/Test-123/comment

 

{"errorMessages":["Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@6851c17a; line: 1, column: 2] (through reference chain: com.atlassian.jira.issue.fields.rest.json.beans.CommentJsonBean[\"body\"])"]}+  

 

1 comment

Hi @Pravin 

I think you're using the API v3 version of mentioning users while calling the v2 endpoint!

Like Pravin likes this

Hi @Prince Nyeche ,

Thanks for your response 

Is there any API in V2 to mention user in comment ?

Hi @Pravin 

I believe in v2 for servers you can use this format

curl -D- -u admin:adminxyz -X POST 
--data '{"body": "Hi [~XYZ]"}'
-H "Content-type: application/json" https://myjira-prod.com/rest/api/2/issue/Test-123/comment
Like Pravin likes this

Hi @Prince Nyeche ,

 

Thank you it is working now !

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,093 views 18 32
Read article

Atlassian Community Events