How to get list of space and page watches for a user
Purpose
To get all the space and page watches of a user from the database.
Solution
The following queries have been tested in PostGreSQL
Get Page Watches - Replace <user_name> with actual username
SELECT c.contentid, c.title, s.spacekey
FROM CONTENT c
JOIN SPACES s
ON c.spaceid = s.spaceid
JOIN NOTIFICATIONS n
ON c.contentid = n.contentid
JOIN user_mapping um
ON n.username = um.user_key
WHERE um.username = '<user_name>';
Get Space Watches - Replace <user_name> with actual username
SELECT s.spaceid, s.spacekey, s.spacename
FROM SPACES s
JOIN NOTIFICATIONS n
ON s.spaceid = n.spaceid
JOIN user_mapping um
ON n.username = um.user_key
WHERE um.username = '<user_name>';
Last modified on Jun 14, 2019
Powered by Confluence and Scroll Viewport.