I'm trying to create a user macro that defines some variables and repeats them in the page wherever necessary.
So I have one macro with body for the definition of the variable:
#set ($containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager'))
#set ($getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null))
#set ($containerManager=$getInstanceMethod.invoke(null,null))
#set ($containerContext=$containerManager.containerContext)
#set ($contentPropertyManager=$containerContext.getComponent('contentPropertyManager'))
$contentPropertyManager.setStringProperty($content, $paramId, $body)
And one that outputs it again:
$contentPropertyManager.getStringProperty($content, $paramId)
This setup works nicely for any kind of texts and even dates. However when I enter a user mention, it will not be repeated in its entirety.
Only the blue @ is present, and the HTML source code shows
<a data-base-url="http://c" data-hasbody="false" ...> </a>
instead of
<a data-base-url="http://confluence.acme.com" data-hasbody="true" ...>Doe, John</a>
The link still has the correct popup.
What could possible the reason for that behavior? How can I fix it?
(I asked this question on StackOverflow as well.)