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
i am getting below error
{"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\"])"]}+
Just to clarify, in practive it looks like: [~accountid:5c6b8ee0e1bcdf6294d08676]. Spend some time to figure the final state
Hey Pravin,
Check this one,
curl D -u username:password -X POST --data '{"type":"mention","body":"hi [~user]"}' -H "Content-Type: application/json" http://myjira:8080/rest/api/2/issue/COM-1/comment
Regards,
Sunil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sunil, I am getting the below result when using "hi [~pamishra]" (where "pamishra" is a valid user name) to tag a user in the comment, this "User" when clicked takes me to a page saying the user does not exist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also need an answer for this issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make sure you have a valid user. This works and has been tested.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lorna Jones , found a way through this, after recent updates [~<username>] does not work in order to tag a user in JIRA comment.
Try [~accountid:{<accountid>}].
This worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for replying, that is the work-around I came to the conclusion of as well! :) - I do wish this was documented a bit better, rather than letting users stumble through forums for useful comments!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
[~accountid:{<accountid>}] does work, is there any official documentation about this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wrong! It still works. Probably you are formatig the string not properly. your finall string should looks like something similar (with different accountId value) to this:
[~accountid:712010:587cdfd3-1064-41ce-9637-da9a4da55666]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.