Forums

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

Space name using child page ID

Sal
Contributor
April 11, 2022

Hello Team,

I have a page ID and would like to find the name of the space where it's located. Is there a way I can do this? Maybe using some API?

Regards

4 answers

1 accepted

5 votes
Answer accepted
Fabio Racobaldo _Herzum_
Community Champion
April 11, 2022

Hi @Sal ,

you can retrive all the space information associated using the following REST https://docs.atlassian.com/ConfluenceServer/rest/7.17.1/#content-getContentById

You should be able to get Space info associated :

...."space": { "title": "Space", "type": "object", "properties": { "id": { "type": "integer" }, "key": { "type": "string" }, "name": { "type": "string" }, "icon": { "type": "array", "items": { "$ref": "#/definitions/icon" } },

Hope this helps,

Fabio

Sal
Contributor
April 11, 2022

@Fabio Racobaldo _Herzum_ This page has restrictions on it and I can't get details after running with page ID.

I will need the space name to remove the restrictions on the page. Any other suggestions you have?

Fabio Racobaldo _Herzum_
Community Champion
April 11, 2022

if so, you need to perform a query at DB level like the following :

select sp.*
from content con
inner join spaces sp on I(con.SPACEID=sp.SPACEID)
where con.CONTENTTYPE = 'PAGE'
and con.CONTENTID=YOUR_PAGE_ID_HERE;

Fabio

Like # people like this
0 votes
Hendrik Huerkamp
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 3, 2024

If you just need to get the Space and the linked page in human readable for one time (without Macro etc.) you just could try to open that page and look into the Audit log, cause a request for a restricted page, where you don´t have the needed rights will result in a audit log listing. In the audit log the space and respective page is linked.

hope that helps.

0 votes
G subramanyam
Community Champion
April 11, 2022

Hi @Sal welcome to the Atlassian community.

I found your query interesting and did some search to pull out this document the speaks about "Children Display Macro". This might be a good starting point if you haven't explored already.

0 votes
Jorden Van Bogaert
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.
April 11, 2022

Hi @Sal 

If you have permissions to view the page you can use this URL format:

<base URL>/pages/viewpage.action?pageId=<pageid>

Hope this helps
Kind regards
Jorden

Suggest an answer

Log in or Sign up to answer