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
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events