Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can we get the logged in users favourite spaces via user macro?

Niharika Shrivastava October 31, 2014

Class : com.atlassian.confluence.plugins.macros.dashboard has a method getFavouriteSpaces() 

can anybosy help, how can we use it in a user macro.

1 answer

1 accepted

0 votes
Answer accepted
Davin Studer
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.
October 31, 2014

This should do it.

## Developed by: Davin Studer
## Date created: 06/10/2013
## @noparams
#set( $labelManager = $action.LabelManager )
#set( $favRef = $labelManager.getLabel("my:favourite") )
#if($favRef)
    #set( $favorites = $labelManager.getCurrentContentForLabel( $favRef ) )
    #if($favorites.size() > 0)
        <ul>
        #foreach( $favorite in $favorites )
            #if ( $favorite.getType() == "spacedesc" || $favorite.getType() == "personalspacedesc" )
            <li><a href="$favorite.UrlPath">$favorite.DisplayTitle</a></li>
            #end
        #end
        </ul>
    #end
#end
Niharika Shrivastava October 31, 2014

Perfect!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events