You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Where can I find the Space Category in the database?
Does it have to be DB? The schema doc doesn't clearly show the relation between the 'label' table and the 'space' table.
https://confluence.atlassian.com/doc/confluence-data-model-127369837.html
You can execute this as a starting point:
select * from label where NAMESPACE = "team"
However, I'm not 100% sure that labels in the 'global' namespace cannot also be used on spaces. So, I don't know if the above query returns a complete dataset. This query gets both global and space labels but not page-specific ones.
select * from label where NAMESPACE = "team" or NAMESPACE = "global"
Either way, those queries only give you what labels have been added and does not show any relation to what they were added to, which may be what you're actually looking for.
It's fairly trivial to get that data from the REST API and then parse it as needed:
# DB
select spacekey from spaces
# API - you'll have to paginate through the
https://<confluence-url>/rest/api/space?limit=500
https://<confluence-url>/rest/api/space?spaceKey=<SPACEKEY>&expand=metadata.labels
Your output will look something like this for each request:
{
"results": [
{
"id": "<SPACE-ID>",
"key": "<SPACE-KEY>",
"name": "<SPACE-TITLE>",
"type": "global",
"metadata": {
"labels": {
"results": [
{
"prefix": "team",
"name": "<LABEL-NAME>",
"id": "<LABEL-ID>"
},
{
"prefix": "team",
"name": "<LABEL-NAME>",
"id": "<LABEL-ID>"
},
{
"prefix": "team",
"name": "<LABEL-NAME>",
"id": "<LABEL-ID>"
}
],
"start": 0,
"limit": 200,
"size": 3
}
},
"_links": {
"webui": "/display/<SPACE-KEY>",
"self": "https://<confluence-url>/rest/api/space/<SPACE-KEY>"
},
"_expandable": {
"icon": "",
"description": "",
"homepage": "/rest/api/content/<SPACE-HOME-ID>"
}
}
],
"start": 0,
"limit": 25,
"size": 1,
"_links": {
"self": "https://<confluence-url>/rest/api/space?spaceKey=<SPACE-KEY>&expand=metadata.labels",
"base": "https://<confluence-url>",
"context": ""
}
}
Hopefully that's a starting point for you. Good luck!
Thanks for the detailed response.
This at least gives me one avenue to get what I need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.