How to get the Subscribers and Creator of a Calendar

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Summary

The purpose of this document is to provide the steps to get a list of users subscribed to a specific calendar, or the creators of a calendar. 

If you are interested in getting a list of the users watching a specific calendar, please check How to get the users Watching a Calendar

Solution

Subscribers

For Team Calendars 4.2 and later...

Run the following query to get a list of the subscribers of every Calendar in your Confluence site: 

SELECT tc."NAME" AS "Calendar Name", um."username" AS "Subscriber" 
FROM "AO_950DC3_TC_SUBCALS" tc
LEFT JOIN "user_mapping" um ON um."user_key" = tc."CREATOR"
WHERE "PARENT_ID" IS NULL AND "SUBSCRIPTION_ID" IS NOT NULL
ORDER BY 1,2

(warning) If you need to filter by Calendar name, just add a WHERE clause based on tc."NAME" column. 

Creators

For Team Calendars 4.1 and earlier...


  1. Replace the <calendar_name> with the name of the calendar that you wish to find its creator.

    select BANDANACONTEXT from  BANDANA where BANDANAVALUE like '%X-WR-CALNAME:<calendar_name>%';
  2. Now Run the next query. Replace the <BANDANACONTEXT> with the previous query result

    select BANDANAVALUE from  BANDANA where BANDANACONTEXT = '<BANDANACONTEXT>';
  3. The output of this query should be similar to the one below: 

    |
        <string>{"id":"1c0ecd7a-0cf8-4db2-a3ec-11706f28ddfe","color":"subcalendar-turquoise","description":"ert","name":"trte","spaceKey":"","creator":"admin","timeZoneId":"Asia/Calcutta"}</string>
         |
        |
        <string>{"id":"6dc2caf6-5261-4de2-a3e7-eff19ffbebba","color":"subcalendar-blue2","description":"sdfsd","name":"dfsg","spaceKey":"","creator":"admin","timeZoneId":"Asia/Calcutta"}</string> 
         |


    (info) From the result, you can see the creator name, in this case it is 'admin'


For Team Calendars 4.2 and later...


Run the following query to get the users who created every Calendar in your Confluence site:

SELECT tc."NAME" AS "Calendar Name", um."username" AS "Creator", to_timestamp(CAST(tc."CREATED" AS bigint) / 1000) AS "Creation Date"
FROM "AO_950DC3_TC_SUBCALS" tc
LEFT JOIN "user_mapping" um ON um."user_key" = tc."CREATOR"
WHERE "PARENT_ID" IS NULL AND "SUBSCRIPTION_ID" IS NULL
ORDER BY 1,2
SELECT um.lower_username as creator, tc.NAME as calendar_name, tc."SPACE_KEY" as Space, from_unixtime(round(tc.created/1000)) as creation_date
FROM AO_950DC3_TC_SUBCALS tc
JOIN user_mapping um ON um.user_key = tc.CREATOR
WHERE tc.PARENT_ID IS NULL
ORDER BY creator;
SELECT um.lower_username as creator, tc.NAME as calendar_name, tc."SPACE_KEY" as Space, dateadd(second,cast(cast(tc.CREATED AS nvarchar(255)) AS bigint)/1000,'19700101 00:00:00:000') as creation_date
FROM AO_950DC3_TC_SUBCALS tc
JOIN user_mapping um ON um.user_key = tc.CREATOR
WHERE tc.PARENT_ID IS NULL
ORDER BY creator;
SELECT um.lower_username as creator, tc.NAME as calendar_name, tc."SPACE_KEY" as Space, to_date('01.01.1970','dd.mm.yyyy') + to_number(tc.created)/1000/60/60/24 AS creation_date
FROM AO_950DC3_TC_SUBCALS tc
JOIN user_mapping um ON um.user_key = tc.CREATOR
WHERE tc.PARENT_ID IS NULL
ORDER BY creator; 

(warning) If you need to filter by Calendar name, just add a WHERE clause based on tc."NAME" column. 

There is an open suggestion to implement a functionality to know who is the creator of a calendar in the UI:  

CONFSERVER-51216 - Getting issue details... STATUS







Last modified on Aug 15, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.