java.lang.Object
com.atlassian.confluence.api.model.content.History
All Implemented Interfaces:
NavigationAware

public class History extends Object implements NavigationAware
Contains the history of a piece of Content.

History refers to the published version of Content. Be careful when using expand=history when looking at content with status=draft: the information will refer to the published Content, if any. See the javadoc on individual methods for more details, e.g. getCreatedAt(), getLastUpdatedRef(), getNextVersionRef().

  • Method Details

    • builder

      public static History.HistoryBuilder builder()
    • buildReference

      public static Reference<History> buildReference(Reference<Content> contentParent)
    • getParentReference

      public static Reference<Content> getParentReference(Reference<History> historyReference)
    • getLastUpdatedRef

      public Reference<Version> getLastUpdatedRef()
      Get information about the latest published non-draft version of the content.

      Special notes for drafts:

      • For drafts of existing published content, this shows the last published version, not the draft.
      • For drafts of new content (unpublished), this will be an empty reference, because there is no history yet.
      To see modification information for a draft, use expand=version.

      Returns:
      the latest published non-draft version, or an empty reference if this is an unpublished draft
    • getNextVersionRef

      public Reference<Version> getNextVersionRef()
      Get the next version, if this is not the newest version.

      Note draft content only has a single version, so will return an empty reference.

      Returns:
      the next version, or an empty reference if there is no next version or if draft
    • getPreviousVersionRef

      public Reference<Version> getPreviousVersionRef()
      Get the previous version, if this is not the oldest version.

      Note draft content only has a single version, so will return an empty reference.

      Returns:
      the previous version, or an empty reference if there is no previous version or if draft
    • isLatest

      public boolean isLatest()
      Is this the latest published (non-draft) version of the content?

      This method will always return false for draft content.

      Returns:
      true if this content is the highest version (hence it will have no nextVersion); false if not highest, or if draft
    • getCreatedBy

      public Person getCreatedBy()
      Get the original creator of the first published non-draft version of the content.

      Special notes for drafts:

      • For drafts of existing published content, this shows the original creator, not the draft editor.
      • For drafts of new content (unpublished), this will be null, because there is no history yet.
      To see the editor of a draft, use expand=version and see Version.getBy().

      Returns:
      the creator of the first published non-draft version, or null if this is an unpublished draft
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      Get the original publish time of the first published non-draft version of the content.

      Special notes for drafts:

      • For drafts of existing published content, this shows the original publish time, not the draft modification time.
      • For drafts of new content (unpublished), this will be null, because there is no history yet.
      To see the modification time of a draft, use expand=version and see Version.getWhenAt().

      Returns:
      the publish time of the first published non-draft version, or null if this is an unpublished draft
      Since:
      8.6
    • getContributors

      public Reference<Contributors> getContributors()
    • getContentParentRef

      public Reference<Content> getContentParentRef()
    • resolveNavigation

      public Navigation.Builder resolveNavigation(NavigationService navigationService)
      Specified by:
      resolveNavigation in interface NavigationAware