How to display modified page dates in a table?

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.

Summary

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?

Solution

Be mindful that customisations are not part of our support scope as per Atlassian Support Offerings. Any effort provided to support issues related to customisation 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. Click Add
  5. Use the user macro in the page
  6. Result example

Last modified on May 20, 2020

Was this helpful?

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