How to display modified page dates in a table?

お困りですか?

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

コミュニティに質問


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

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.

*Fisheye および Crucible は除く

要約

We have created a table with 2 columns. One column for a document name and the other column for last modified date. Is there a way of automatically displaying a modified date in the respective rows when a document is updated?

ソリューション

Be mindful that customizations are not part of our support scope as per Atlassian Support Offerings. Any effort provided to support issues related to customization will be on a best-effort basis by the support engineer.

The following User Macro could help:

  1. Go to icon > General Configuration > User Macros
  2. Choose Create a User Macro
  3. Enter the macro details template

    ## @param Page:title=Page|type=confluence-content|required=true|desc=Choose Page to get last modified date for
    #set ( $colonIndex = $paramPage.indexOf(":") )
    #if ( $colonIndex == -1 )
    #set ( $spaceKey = $space.key )
    #set ( $pageName = $paramPage )
    #else
    #set ( $spaceKey = $paramPage.substring(0, $colonIndex) )
    #set ( $pageNameIndex = $colonIndex + 1 )
    #set ( $pageName = $paramPage.substring($pageNameIndex) )
    #end
    #set ( $requestedPage = $pageManager.getPage($spaceKey, $pageName) )
    $action.dateFormatter.formatDateTime($requestedPage.lastModificationDate)
  4. [追加] をクリックします。
  5. Use the user macro in the page
  6. 結果の例


On recent versions of Confluence (7.19.7 and later), some Velocity template modules won't be rendered in a user macro. Those modules were restricted due to security measures, which can be seen in the CONFSERVER-82741 - Getting issue details... STATUS bug report. Please refer to the bug link for more information on it, as well as a workaround.

最終更新日 2024 年 11 月 17 日

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

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