Hi @frithjof falck ,
please create a user macro, with name and categories at your convenience, with :
## Macro title: My Macro
## Macro has a body: Y or N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: My Name
## This is an example macro
## @noparams
#if($spaceManager.getPersonalSpace($action.remoteUser))
$spaceManager.getPersonalSpace($action.remoteUser).getKey()
#else
No Personal Space
#end
Key of the current user will appear if the current user has a Personal Space. Hope this helps, Fabio
@frithjof falck if you need a link to that space please change Macro Body processing and add <a> in my previous code.
Ciao,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!
Any chance of getting the home space key of the user instead of the personal space key? If that makes any sense.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @frithjof falck ,
what you mean the home space key for the current user? User can have a personal space or he could be the creator of many spaces?
WHat link do you need?
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The current users space key where the homepage as set under profile settings is located.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't find any API that is able to retrieve this setting.
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.
Please follow the Guide here to create the User Macro
Macro Name: spacekey
Macro Title: Space Key
Description: Adds the current space key as text
Category: Confluence Content
Macro Body Processing: No macro body
Output Format: HTML
Template: $space.getKey()
Let me know if this works
Thanks,
Pramodh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any possibilities for the output to be the current users spacekey? I'going to add it in a <a> tag so that the user will be directeded back to its home space
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.