Hello, I'm trying to add a comment with a mention to some users using Confluence API.
This is the request:
{
"type": "comment",
"mode": "create",
"container":
{
"id": "pagId",
"type": "page"
},
"body": {
"storage": {
"value": "THIS S A TEST. PLEASE IGNORE THIS COMMENT.<ac:link><ri:user ri:userkey=\"userId1\"/></ac:link>, <ac:link><ri:user ri:userkey=\"userId2\"/></ac:link>, <ac:link><ri:user ri:username=\"name.surname\"/></ac:link>",
"representation": "storage"
}
}
}
It is working, but the users' name is "unlicensed user" and these users have a license.
Hi @María Cabrera, are you using the account id for the userkey? Try that instead; it should work. You can mention someone and view the storage format of the page to confirm the syntax.
<ac:link><ri:user ri:userkey="8a7f808a7******************eb330006"/></ac:link>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tested it myself, and it turns out that userkey works, but the account id doesn't. You can get the userkey by mentioning a user on a page, publishing it, and accessing the "view storage format" settings (More actions > Advanced details > View Storage Format).
I know Atlassian is deprecating username and userkey from the APIs and using the account id instead. Maybe this is yet to roll out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.