0

I am trying to insert a mention in a confluence page through the REST API.

I tried placing the [~xxxx] in the middle of the content but it doesn't seem to work. When I open the page I see [~xxxx] instead of a link to the mentioned user.

I placed that string in the body>storage>value

I have tried also with <ri:user ri:userkey="xxuserkeyxxx"/> but, in this case, I do not see anything on the page.

Any ideas? Thanks a lot.

Found the reason why wasn't working, it needs to be:

<ac:link><ri:user ri:userkey="xxuserkeyxxx"/></ac:link>

I was missing the ac:link tag. After adding it, works fine. I wasn't able to find it on the official doc: https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html

slawert
  • 1
  • 3

2 Answers2

0

You need to use a link with the content being the user's user key

<ac:link><ri:user ri:userkey="f081435773s808c3014357744847024c" /></ac:link>

If you ever need to figure out the correct syntax for storage format:

  1. edit a page and, in this case, @mention someone
  2. go to the "..." menu and View Storage Format to see the result.
dvdsmpsn
  • 2,839
  • 1
  • 26
  • 40
0

ri:userkey is deprecated. Instead use account-id.

<ac:link><ri:user ri:account-id=<accountId> /></ac:link>