> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leen.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List ITSM Comments

> List comments on tickets. Pass `ticketId` to scope the results; the underlying vendors require it, so a request without it is rejected.



## OpenAPI

````yaml get /itsm/comments
openapi: 3.1.0
info:
  title: Leen Security API
  version: 0.0.1
servers:
  - description: Production API (US)
    url: https://api.leen.dev/v1
  - description: Production API (EU)
    url: https://api.eu-c1.leen.dev/v1
  - description: Production API (APAC)
    url: https://api.ap-se2.leen.dev/v1
security: []
paths:
  /itsm/comments:
    get:
      tags:
        - ITSM
        - Comments
      summary: List ITSM Comments
      description: >-
        List comments on tickets. Pass `ticketId` to scope the results; the
        underlying vendors require it, so a request without it is rejected.
      operationId: get_comments
      parameters:
        - description: Filter comments by ticket ID
          in: query
          name: ticketId
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            description: Filter comments by ticket ID
            title: Ticketid
        - description: >-
            Only records whose `updated_at` is at or after this time. Leen bumps
            `updated_at` whenever any field on a record changes, so this is the
            filter for an incremental sync: it returns records that are new and
            records that changed, and nothing that has stood still. Example:
            `2021-01-01T00:00:00+00:00`.
          in: query
          name: updatedSince
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: >-
              Only records whose `updated_at` is at or after this time. Leen
              bumps `updated_at` whenever any field on a record changes, so this
              is the filter for an incremental sync: it returns records that are
              new and records that changed, and nothing that has stood still.
              Example: `2021-01-01T00:00:00+00:00`.
            examples:
              - '2021-01-01T00:00:00+00:00'
            title: Updatedsince
        - description: >-
            Opaque position of the next page, taken from the previous response.
            Ignore its contents; it encodes where the walk had reached.
          in: query
          name: cursor
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque position of the next page, taken from the previous
              response. Ignore its contents; it encodes where the walk had
              reached.
            title: Cursor
        - description: >-
            How many records to return per page. The walk is the same either
            way; a larger page means fewer round trips and more memory per
            response.
          in: query
          name: limit
          required: false
          schema:
            default: 100
            description: >-
              How many records to return per page. The walk is the same either
              way; a larger page means fewer round trips and more memory per
              response.
            maximum: 500
            minimum: 1
            title: Limit
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/KeySetPaginatedResponse_ScopedITSMCommentRespModel_
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
      security:
        - API-Key: []
          Connection-ID: []
components:
  schemas:
    KeySetPaginatedResponse_ScopedITSMCommentRespModel_:
      properties:
        items:
          description: The records on this page.
          items:
            $ref: '#/components/schemas/ScopedITSMCommentRespModel'
          title: Items
          type: array
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque position of the next page. Pass it back as `cursor` to
            continue; null when this is the last page.
          title: Next Cursor
        previous_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque position of the previous page, for walking backwards. Null on
            the first page.
          title: Previous Cursor
      required:
        - items
      title: KeySetPaginatedResponse[ScopedITSMCommentRespModel]
      type: object
    ErrorResponse:
      properties:
        code:
          description: Error code
          title: Code
          type: string
        detail:
          description: List of error dictionaries
          items:
            additionalProperties: true
            type: object
          title: Detail
          type: array
        message:
          description: Error message
          title: Message
          type: string
        type:
          description: Type of error
          title: Type
          type: string
      required:
        - type
        - code
        - message
        - detail
      title: ErrorResponse
      type: object
    ScopedITSMCommentRespModel:
      properties:
        author_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: User ID of the Comment author
          title: Author Id
        body:
          description: Text content of the Comment
          title: Body
          type: string
        id:
          description: Leen's UUID for the Comment
          format: uuid
          title: Id
          type: string
        ticket_id:
          description: Ticket ID the Comment belongs to
          format: uuid
          title: Ticket Id
          type: string
        vendor_attributes:
          $ref: '#/components/schemas/ITSMCommentVendorAttributes'
          description: Vendor-specific attributes of the Comment
      required:
        - id
        - body
        - ticket_id
        - vendor_attributes
      title: ITSM Comment
      type: object
    ITSMCommentVendorAttributes:
      properties:
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Creation time of the Comment in Vendor
          title: Created At
        data:
          anyOf:
            - discriminator:
                mapping:
                  JIRA: '#/components/schemas/JiraCommentVendorAttributesData'
                  SERVICENOW_ITSM: '#/components/schemas/ServiceNowCommentVendorAttributesData'
                propertyName: vendor
              oneOf:
                - $ref: '#/components/schemas/JiraCommentVendorAttributesData'
                - $ref: '#/components/schemas/ServiceNowCommentVendorAttributesData'
            - type: 'null'
          description: Vendor-specific data associated with the Comment
          title: Data
        id:
          description: Vendor's ID for the Comment
          title: Id
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Last update time of the Comment in Vendor
          title: Updated At
        vendor:
          description: Vendor name
          title: Vendor
          type: string
      required:
        - id
        - vendor
      title: ITSM Comment Vendor Attributes
      type: object
    JiraCommentVendorAttributesData:
      properties:
        originalBody:
          anyOf:
            - {}
            - type: 'null'
          title: Originalbody
        vendor:
          const: JIRA
          default: JIRA
          title: Vendor
          type: string
      title: JiraCommentVendorAttributesData
      type: object
    ServiceNowCommentVendorAttributesData:
      properties:
        createdByUsername:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdbyusername
        element:
          anyOf:
            - type: string
            - type: 'null'
          title: Element
        elementId:
          anyOf:
            - type: string
            - type: 'null'
          title: Elementid
        vendor:
          const: SERVICENOW_ITSM
          default: SERVICENOW_ITSM
          title: Vendor
          type: string
      title: ServiceNowCommentVendorAttributesData
      type: object
  securitySchemes:
    API-Key:
      in: header
      name: X-API-KEY
      type: apiKey
    Connection-ID:
      in: header
      name: X-CONNECTION-ID
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.