You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi Team,
We use confluence data center LTS version 7.13.4 and have around 1800 client spaces to manage, we need to gather data for all the spaces like space name, space key and space admin details.
Kindly provide a way either by UI, API or SQL to fetch the above information.
Thanks
Hi @Jayesh Raghuvanshi ,
You can use HTML amcro and JS like:
let spaces = []
async function getSpaces() {
let spResp = await fetch('/rest/api/space');
let spacesJson = await spResp.json();
spaces.push(...spacesJson.results )
let nextLink = spacesJson._links_next;
while(nextLink !== undefined) {
let tempResp = await fetch(nextLink);
let tempSpacesJson = await tempResp .json();
spaces.push(...tempResp.results )
let nextLink = tempSpacesJson._links_next;
}
}
getSpaces()
...
With REST API it will be rather slow.
2) You can use JAVA SDK https://docs.atlassian.com/ConfluenceServer/javadoc/7.18.0/ and Groovy Runner / ScrptRunner to get necessar info (it wll be much faster)
def spaceManager = ComponentAccessor.getCOmponent(SpaceManager.class)
def spaces = spaceManager.getAllSpaces;
spaces.each {
out << it .name
out << it.key#
...
}
3) You can create macro with JAVA SDK https://docs.atlassian.com/ConfluenceServer/javadoc/7.18.0/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.