What is the confluence source code for a user mention?

Christopher Atterbury April 19, 2023

I am attempting to mention users with the new ability in Quarto to publish to Confluence. Quarto allows for raw Confluence blocks, so my plan is to put in the source code for mentioning particular users in there. I found that in the Resource Identifier section of the Confluence Storage Document page there is the "user" resource referenced with

<ri:user ri:userkey="2c9680f7405147ee0140514c26120003"/>

I replaced this with the appropriate user key, but could not get it to work properly with the @User_name text.

What is the raw confluence code that I should use for a user mention? Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Andrii Maliuta
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.
April 20, 2023

Hello @Christopher Atterbury ,

The page has several types of BODY representation and if you use final HTML, you should consider 'VIEW' representation:

```

<a class=\"confluence-userlink user-mention\" data-username=\"XXXX\" data-account-id=\"XXXX\" href=\"https://x.atlassian.net/wiki/people/XX?ref=confluence\" target=\"_blank\" data-linked-resource-id=\"98305\" data-linked-resource-version=\"1\" data-linked-resource-type=\"userinfo\" data-base-url=\"https://x.atlassian.net/wiki\">John Doe</a>

```

It is persisted in the database as STORAGE state:

<ac:link><ri:user ri:account-id="5d26e612590c9c0c25f78ee8" /></ac:link>

 but is rendered in HTML (VIEW) when viewing it in UI.

You can use REST API to get this data:

https://xx.atlassian.net/wiki/rest/api/content/1111?expand=body.view

https://xx.atlassian.net/wiki/rest/api/content/1111?expand=body.storage

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events