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.