How to list the users favourite pages and spaces
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
The query below will list all the users favourite pages and spaces. The entries in the result which does not have page title are favourite spaces .
Solution
SELECT USER_MAPPING.username,content.spaceid,content.title ,spaces.spacekey,spaces.spacename
FROM LABEL
JOIN USER_MAPPING
ON LABEL.owner = USER_MAPPING.user_key
LEFT JOIN CONTENT_LABEL
ON LABEL.LABELID = CONTENT_LABEL.LABELID
JOIN CONTENT
ON CONTENT_LABEL.CONTENTID = CONTENT.CONTENTID
JOIN SPACES
ON CONTENT.spaceid = spaces.spaceid
WHERE LABEL.NAME='favourite'