How to Get a List of Users Who Have Modified Content Recently

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

目的

Sometimes it is useful for an administrator to find which users have created or edited content recently or on a specific date. This KB illustrates how to query the database via SQL to retrieve this information quickly.

Related KBs:

ソリューション

Users who have created or edited content since a specific date

The example SQL below retrieves all users who have created or edited content since May 1, 2016. The date can be modified as needed. Note that different databases may have different formats for the date field as well, which may require further tweaks.

  • On PostgreSQL:

    SELECT um.lower_username
    FROM user_mapping um
    JOIN CONTENT c
      ON um.user_key = c.lastmodifier
    WHERE c.lastmoddate >= '2016-05-01'
    GROUP BY um.lower_username;
  • On MS SQL:

    SELECT um.lower_username
    FROM user_mapping um
    JOIN CONTENT c
      ON um.user_key = c.LASTMODIFIER
    WHERE c.LASTMODDATE >= '2016-05-01'
    GROUP BY um.lower_username;
  • On Oracle:

    SELECT um.lower_username
    FROM user_mapping um
    JOIN CONTENT c
      ON um.user_key = c.lastmodifier
    WHERE c.lastmoddate >= '01-Jan-2016'
    GROUP BY um.lower_username;

The last modification/creation of pages, blog posts, or comments

The SQL query below will provide you a list of those users separated by spaces (space keys starting with ~ are referring to personal spaces).

  • On PostgreSQL or MS SQL:

    SELECT s.SPACEKEY,s.SPACENAME,u.username, MAX(c.LASTMODDATE) AS lastabsolutemoddate
    FROM CONTENT c
    JOIN user_mapping u ON u.user_key=c.LASTMODIFIER
    JOIN SPACES s ON s.SPACEID = c.SPACEID
    WHERE c.CONTENTTYPE !='USERINFO'
      AND c.LASTMODIFIER IS NOT NULL
      AND c.SPACEID IS NOT NULL
    GROUP BY s.SPACEKEY,s.SPACENAME,u.username
    ORDER BY s.SPACEKEY,u.username;


最終更新日 2024 年 11 月 19 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.