Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira API to tag user in Comment

Pravin August 16, 2021

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\"])"]}+  

 

5 answers

1 vote
Prince Nyeche
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.
August 18, 2021

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
1 vote
Prince Nyeche
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.
August 16, 2021

Hi @Pravin 

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

0 votes
Benny Horowitz January 6, 2022 edited

/

0 votes
Pravin August 19, 2021

Hi @Prince Nyeche ,

 

Thank you it is working now !

0 votes
Pravin August 17, 2021

Hi @Prince Nyeche ,

Thanks for your response 

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

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events