Labellist macro on more than on space
Asked by Stephan Haas:

Hey there,

we have build a great wiki consisting of 10 spaces now.

To keep track of all the attached labels in those spaces, it would be nice to have an option to have an overview on all pages.

So far i tried to achieve this with the labels list macro, but this is just limited to one space if iam not mistaken. If i use the macro for each space, they all still show up separated and that is not what we are aiming for.

So the ultimate question: is there a possibility to create a list of labels from several spaces?

Thanks in advance!


Answers:
author: Nicolai Sibler
body: Hi Stephan,

as a workaround, here's a SQL that returns all the labels of the instance and their count per space.

You could export the results to excel and attach the doc to a page if you want to view it in Confluence.

```
select s.spaceid,
s.spacename,
s.spacekey,
cl.labelid,
l.name,
count 

from CONFLUENCE.CONTENT t

join confluence.spaces s
on t.spaceid = s.spaceid
and s.spacetype = 'global' 

join confluence.content_label cl
on t.contentid = cl.contentid

join confluence.label l
on cl.labelid = l.labelid
and l.namespace = 'global' 


where t.prevver is null 
and t.contenttype='PAGE' 
and t.content_status = 'current' 

group by s.spaceid,
s.spacename,
s.spacekey,
cl.labelid,
l.name

order by s.spacename
```

Hope that helps!

Kind regards,

Nicolai

comments: author: Stephan Haas
body: Hey [@Nicolai Sibler](/t5/user/viewprofilepage/user-id/2649119) !

Thank you for pointing out this possibility. We'll look into it and this might be a workaround for this issue.

Much appreciated and with kind regards,

Stephan


author: Dave Mathijs
body: Hi [@Stephan Haas](/t5/user/viewprofilepage/user-id/4986576) welcome to the Atlassian Community!

When you use the 'Content by Label' macro, it isn't limited to the actual space by default.

However, you need unrestricted access to the pages of other spaces that contain that label to see those pages as well.

comments: author: Stephan Haas
body: Hi [@Dave Mathijs](/t5/user/viewprofilepage/user-id/2662590)

thank you for the warm welcome.

When using the Content by label, it is only showing all labels from this one dedicated space. When clicking on ...from all spaces, it shows a list of labels that are not ours. Most likely this is an issue because we are using a data center and share licenses.

Our idea is to have one dedicated page where all labels, from all spaces are located. Since we have so many spaces and soon will have our 150+ users actively participating in them. This will most likely lead to an increase of wild labeling and we want to have them all in one spot to check them through on a weekly basis, to keep it clean.

Maybe you have another workaround, because we tried every possible way until now. A cql request wouldnt make sense, because we would have to add all labels into it.

For now we use a single page to display each space labels. It is working, but is not really the way we would like to have it.

Thank you very much for your time !


author: Dave Mathijs
body: The 'Label List' Macro is indeed limited to the current space if not specified.

A third-party app like [**Label Manager for Confluence**](https://marketplace.atlassian.com/apps/1212110/label-manager-for-confluence?hosting=server&tab=overview) might be a solution for better management.


author: Stephan Haas
body: Good morning and hello to a new week again!

Assigning the 'Label List' macro to several spaces at once is not possible correct?


Tags: confluence-server

label

macro

server