Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

GetSpacesByType User Macro

C_ G_
Contributor
November 10, 2022

Hi All!

I am using a user macro I found in this community to get a list of all spaces.

This is done e.g. by using

#set($spaces = $spaceManager.getAllSpaces())

Now I would like filter only for the global spaces, ignoring the personal user spaces. 

I thought this would do the trick:

#set($spaces = $spaceManager.getSpacesByType(global))

But it does not :-( The macro will not run like this...

Does anyone have an idea? 

I'm on the server version 7.13.8

2 answers

0 votes
C_ G_
Contributor
November 11, 2022

probably my fault...I found it here:

https://docs.atlassian.com/atlassian-confluence/4.3/com/atlassian/confluence/spaces/SpaceManager.html#getSpacesByType(com.atlassian.confluence.spaces.SpaceType)

 

But it seems to be deprecated.

Instead one should use  getSpaces(SpacesQuery query) but I don't get it working

0 votes
Bill Bailey
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.
November 10, 2022

Hello @C_ G_ , what happens when you try .getSpacesByType? I don;t see that method in the docs.

Do you get an array from .getAllSpaces() that you can then filter?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events