Hierarchy

  • CommonHttpService
    • ContentStatesService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns ContentStatesService

Methods

  • Gets the current content state of the draft or current version of content. To specify the draft version, set the parameter status to draft, otherwise archived or current will get the relevant published state. Permissions required: Permission to view the content.

    Parameters

    • params: {
          id: string;
          status?: "current" | "draft" | "archived";
      }
      • id: string

        The id of the content whose content state is of interest.

      • Optionalstatus?: "current" | "draft" | "archived"

        Set status to one of [current,draft,archived]. Default value is current.

    Returns Promise<ContentStateResponse>

    Returned if permission allows viewing of content.

    GET /wiki/rest/api/content/{id}/state @scopes-current read:confluence-content.summary @scopes-beta read:content-details:confluence

  • Returns all content that has the provided content state in a space.

    If the expand query parameter is used with the body.export_view and/or body.styled_view properties, then the query limit parameter will be restricted to a maximum value of 25.

    Permissions required: 'View' permission for the space.

    Parameters

    • params: {
          expand?: string[];
          limit?: number;
          spaceKey: string;
          start?: number;
          stateId: number;
      }
      • Optionalexpand?: string[]

        A multi-value parameter indicating which properties of the content to expand. Options include: space, version, history, children, etc.

        Ex: space,version

      • Optionallimit?: number

        Maximum number of results to return

      • spaceKey: string

        The key of the space to be queried for its content state settings.

      • Optionalstart?: number

        Number of result to start returning. (0 indexed)

      • stateId: number

        The id of the content state to filter content by

    Returns Promise<ContentArray>

    Returned if search was successful.

    GET /wiki/rest/api/space/{spaceKey}/state/content @scopes-current read:confluence-content.all @scopes-beta read:content:confluence

  • Removes the content state of the content specified and creates a new version (publishes the content without changing the body) of the content with the new status.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          id: string;
          status?: "current" | "draft";
      }
      • id: string

        The Id of the content whose content state is to be set.

      • Optionalstatus?: "current" | "draft"

        status of content state from which to delete state. Can be draft or archived

    Returns Promise<ContentStateResponse>

    Returned if content state is removed from content.

    DELETE /wiki/rest/api/content/{id}/state @scopes-current write:confluence-content @scopes-beta write:content:confluence, read:content-details:confluence

  • Sets the content state of the content specified and creates a new version (publishes the content without changing the body) of the content with the new state.

    You may pass in either an id of a state, or the name and color of a desired new state. If all 3 are passed in, id will be used. If the name and color passed in already exist under the current user's existing custom states, the existing state will be reused. If custom states are disabled in the space of the content (which can be determined by getting the content state space settings of the content's space) then this set will fail.

    You may not remove a content state via this PUT request. You must use the DELETE method. A specified state is required in the body of this request.

    Permissions required: Permission to edit the content.

    Parameters

    • params: {
          contentStateRestInput: ContentStateRestInput;
          id: string;
          status: "current" | "draft";
      }
      • contentStateRestInput: ContentStateRestInput

        Content state fields for state. Pass in id for an existing state, or new name and color for best matching existing state, or new state if allowed in space.

      • id: string

        The Id of the content whose content state is to be set.

      • status: "current" | "draft"

        Status of content onto which state will be placed. If draft, then draft state will change. If current, state will be placed onto a new version of the content with same body as previous version.

    Returns Promise<ContentStateResponse>

    Returned if content state is set successfully.

    PUT /wiki/rest/api/content/{id}/state @scopes-current write:confluence-content @scopes-beta write:content:confluence, read:content-details:confluence

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void