Forums

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

Get all labels of all pages of a space

Srinivas Batchu
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!
August 31, 2021

Hi Team,

I'm new to Confluence. I created a Forge Confluence custom UI app for dashboard purposes which queries all the pages of the given space and parses the details of the labels of each page returned in the response.

However, some of the labels are missed and also there is a mismatch in the count of the labels.

I used /wiki/rest/api/space/${spaceKey}/content?start=0&limit=2147483647&expand=metadata.labels to fetch the pages of the given space.

From the JSON response, I parsed the labels from the JSON path data.page.results[i].metadata.labels.results[j].label, where i,j indicates the iteration of each object from an Array,

Thanks!

1 answer

0 votes
Kishan Sharma
Community Champion
August 31, 2021

Hi @Srinivas Batchu Welcome to Atlassian Community!

Can you please confirm how did you verify if the labels have missed and the the count of the labels ? I recently had this discussion which might be of some help to you.

Srinivas Batchu
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!
August 31, 2021

Hi @Kishan Sharma, thanks for the response.

I have also tried the API endpoint you shared in the link which is also not returning all the pages in the space.

Currently, there are two confluence instances. I developed the app in one instance (A) and deployed it in the production environment and shared the link with the second instance (B) to install the app. Is there any limitation applied to the apps installed in this way?. Because I could see this issue only on the second instance (B) in which I installed the app via the sharable link, whereas the first instance (A) is returning all the pages.

I verified by comparing the default labels heatmap macro with my custom labels output and found some of the labels missing. Also, I clicked on labels in the heatmap to view the no. of pages and found there is a mismatch in the count of labels due to missing pages in the returned results.

Just to double-check, I dumped the complete response and found there is no presence of details of missed pages in it.

Kishan Sharma
Community Champion
September 2, 2021

Thank you @Srinivas Batchu for the background. There shouldn't be any limitation applied to instance B. One thing you can check is the permissions on the second instance B if there are restricted pages where you don't have access and if they are not returned in your search.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events