Forums

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

Space list no Archive

Ayelet Gazit January 27, 2022

I am trying to display a list of all non-archived spaces, and the space list macro doesnt seem to have this option.

how can I achieve this?

2 answers

0 votes
Kishan Sharma
Community Champion
January 27, 2022

Hi @Ayelet Gazit Welcome to the Atlassian Community!

Currently the Spaces List Macro lists all spaces, even if they are archived. There is a suggestion raised with Atlassian to not list archived spaces using that macro, which you can track here -

Spaces List Macro should not list archived spaces

I would suggest you to vote for it and start watching it for updates.

Ayelet Gazit January 27, 2022

Thanks, I voted. How else would you suggest me to display a list of active spaces?
I don't mind writing manually which spaces I want to display, but want to be able to display a list of multiple non archives spaces.

Kishan Sharma
Community Champion
January 27, 2022

Great. If you are familiar with REST API,  @Pramodh M has already given a solution in his response (thank you Pramodh for that) which is an efficient way and will save your time.

Like Pramodh M likes this
Ayelet Gazit January 27, 2022

well, I am not really familiar with REST API. How do I use that inside the page? is there a macro for that?

Ayelet Gazit January 27, 2022

@Pramodh M can you point me to a guide / explanation?
Thank you for your help!

Pramodh M
Community Champion
January 27, 2022

Install Git Bash, JQ tools in your local system

https://git-scm.com/downloads

https://stedolan.github.io/jq/

and run the commands replacing all the parameters in API

You need to create a API token in here https://id.atlassian.com/manage-profile/security/api-tokens

Let me know if you have any doubts

0 votes
Pramodh M
Community Champion
January 27, 2022

Hi @Ayelet Gazit 

Welcome to Confluence!!

Using API!!

Here's the API to list down the Spaces in your instance and the API details contains whether the space is active or archived

https://developer.atlassian.com/cloud/confluence/rest/api-group-space/#api-wiki-rest-api-space-get

Thanks,
Pramodh

Pramodh M
Community Champion
January 27, 2022

FYI

Find the example below

curl -s \

--request GET --url "https://your-site.atlassian.net/wiki/rest/api/space?limit=1000&status=archived" \

-H 'Content-Type: application/json' \

--user 'email-id:token' | jq --raw-output .results[].name

Thanks

Pramodh M
Community Champion
January 27, 2022

FYI and to get the Active spaces, change the API as

curl -s \

--request GET --url "https://your-site.atlassian.net/wiki/rest/api/space?limit=1000&status=current" \

-H 'Content-Type: application/json' \

--user 'email-id:token' | jq --raw-output .results[].name

 You need JQ to be installed on order to extract JSON data

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events