User mentions are handled by a macro, which is inserted as an anchor element in the content. You could insert the macro anchor element programmatically. You'd have to know the data use for a few macro parameters to do so.
Here's an example of what the macro anchor element looks like:
The data-id and __default_attr attributes would be the user's id, data-type and data-objecttype will always be person and 3 (Jive's code for the User object type), data-orig-content I believe should match the link text, which is usually the user's name or username.
The data-renderedposition looks like coordinates within the rendered content, but it doesnt appear to have any affect on the actual output.
Hope this helps,
Thank you for sharing that solution. The problem is that the user or place is not static, they change with the user input and that is causing the issues. I should've clarified the problem a little. The above problem is a part of a form where the inputs is the name of the user that is to be tagged and when the form is submitted they automatically get tagged in the post.
Thank you for any help you can offer.