In a Content Report Table, list pages with a label that is used across multiple spaces?
Asked by Joseph M Farrell:

My organization is trying to organize all of our documentation that spans multiple spaces on Confluence. We are now creating a single space to be our source of truth.

We do not want to move all previously created pages to this new space, as users may still be looking at the previous space to reference.

We are hoping that we can add a label to any page (in any space), and in the new space that we create, to have the Content Report Table list all pages with that label, from any space.

Is this possible?


Answers:
author: Heth Siemer
body: The Content Report Table macro defaults to search for all spaces as long as the spaces parameter is blank.

I'm actively doing the same thing in one of my Knowledge Base spaces, as we have documentation in 4-5 different spaces. I'm pulling all the content in our instance with the labels "Chalk" and "Resource" to build my "Chalk Resource Index" of all my how-tos. If you look at my screenshot, I've color coded where the content is coming from. I can pull pages from Space A and blog posts from Space B. They do not have to just be pages.

Lesson learned: Limit your spaces. I should have this limited to Space A \& Space B so I'm neither pulling in someone else's unrelated documentation nor the drafts in my personal space.

If you find your content is not pulling the information correctly, you may want to check your index (I'm not 100% sure how that works on Cloud).

![contentreport.png](https://community.atlassian.com/t5/image/serverpage/image-id/58143i96AB334F9B7869D2/image-dimensions/755x352?v=v2 "contentreport.png")

comments: author: Joseph M Farrell
body: Thank you! That absolutely solves my problem!


author: James Dellow
body: It's also worth remembering that most macros will apply an OR rule to the labels you enter rather than AND. So in the example above, the macro will display any page tagged with the label "chalk" OR "resource".

And it's not really random spaces - the macro is dumb in the sense it simply shows content from spaces you have access not the ones you use (the results are security trimmed, i.e. you only see what you are permitted to see). This also means that someone else viewing this page could see different results if they have access to different or additional spaces where the same labels are also being used.

BTW if you think there is a problem with the index, in Cloud you'll need to raise a support ticket as reindexing is a restricted function.


author: Heth Siemer
body: I did NOT know the labels applies an OR function and that may be why I'm pulling in unrelated documents. Is there a way to force it to apply an AND function?

Also, just so I don't cause any additional confusion, Jame is correct. I said "random space" because we have *thousands* of spaces and I have Sys Admins permissions and see *everything* . So, yes, not a true "random" space. It's just random to me.  

<br />


author: James Dellow
body: Unfortunately, I'm not aware of how to do that with this macro - Confluence can do it (using [CQL](https://developer.atlassian.com/server/confluence/advanced-searching-using-cql/)), which you can try via the advance search page. E.g. try entering these into the search to see the different results:

labelText:(chalk AND chalk)

labelText:(chalk OR chalk)

![Screen Shot 2019-06-21 at 10.20.11.png](https://community.atlassian.com/t5/image/serverpage/image-id/58303i86A2493786DE70EE/image-dimensions/536x57?v=v2 "Screen Shot 2019-06-21 at 10.20.11.png")

However, you can't use that query string in the macro. You might want to look at the free [CQL Search](https://marketplace.atlassian.com/apps/1213090/cql-search?hosting=cloud&tab=overview) app instead or build your own custom app.

PS as you have sys admin permissions, if you want to check what others see try the log in as another user feature <https://confluence.atlassian.com/cloud/log-in-as-another-user-776994835.html>


author: James Dellow
body: The default is to report on all spaces.

comments: author: Joseph M Farrell
body: Unfortunately, that is not the case.

If I have a page is space A with label "test", and I have a Content Report Table in space B, where that table is displaying all pages with label "test"; the page from space A will not be displayed in the table.


author: James Dellow
body: That's odd, because when I saw your reply I tested that macro - when you first add that macro to a page and just enter one or more labels, it does pull from all spaces?

But then reading your comments above, were you specifying the spaces? Or did it not display because you have more than 20 pages tagged with that label and the "Maximum Number of Pages" was set at 20 (the default limit)?


author: Joseph M Farrell
body: A space had been specified, forcing the macro to not grab the other pages.

I have did not realize that I had specified that value previously. Removing the space value in the Content Report Table macro solved the issue.


author: jinfengocu
body: We manage approval and security check of multiple projects. All those relevant pages have got the same page name in different space.

I would like this macro can identify space name as well as page name.

Can anybody find a way to solve this, or is there any other macro can do this?


Tags: cloud

confluence-cloud

label