> ## 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.

# Bulk Update ITSM Tickets (Async)

> Update multiple ITSM tickets asynchronously with the same field values.

Creates an async job to process the bulk ticket updates and returns immediately
with a job_id. Use GET /jobs/{job_id} to poll for job completion and results.

Request:
- ticket_ids: List of 1-50 ticket UUIDs to update
- updates: Fields to update (same for all tickets)
  - status, priority, assigned_user_id, name, description

Response (202 Accepted):
- job_id: UUID to poll for job status and results

Job Status Polling:
- Use GET /jobs/{job_id} to check status
- Status flow: QUEUED → RUNNING → SUCCESS/FAILED
- On SUCCESS: all tickets were updated; no per-ticket result data is returned
- On FAILED: job.failure_reason contains a JSON object with per-ticket breakdown:
  - total/succeeded/failed counts
  - results[]: per-ticket entries with success, error, request_index, ticket_id

This follows the vendor-first pattern:
1. Job updates tickets in the vendor system (e.g., JIRA) using bulk APIs
   - Status changes: Bulk transition API (single get_transitions call + bulk_transition_issues)
   - Field updates: Bulk edit API (only for tickets that succeeded status transition)
2. Updates local database for successfully updated tickets

All update fields are optional. Only provided fields will be updated.

Performance: Returns immediately; processing happens asynchronously



## OpenAPI

````yaml post /itsm/tickets/bulk/update
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/tickets/bulk/update:
    post:
      tags:
        - ITSM
        - Tickets
      summary: Bulk Update ITSM Tickets (Async)
      description: >-
        Update multiple ITSM tickets asynchronously with the same field values.


        Creates an async job to process the bulk ticket updates and returns
        immediately

        with a job_id. Use GET /jobs/{job_id} to poll for job completion and
        results.


        Request:

        - ticket_ids: List of 1-50 ticket UUIDs to update

        - updates: Fields to update (same for all tickets)
          - status, priority, assigned_user_id, name, description

        Response (202 Accepted):

        - job_id: UUID to poll for job status and results


        Job Status Polling:

        - Use GET /jobs/{job_id} to check status

        - Status flow: QUEUED → RUNNING → SUCCESS/FAILED

        - On SUCCESS: all tickets were updated; no per-ticket result data is
        returned

        - On FAILED: job.failure_reason contains a JSON object with per-ticket
        breakdown:
          - total/succeeded/failed counts
          - results[]: per-ticket entries with success, error, request_index, ticket_id

        This follows the vendor-first pattern:

        1. Job updates tickets in the vendor system (e.g., JIRA) using bulk APIs
           - Status changes: Bulk transition API (single get_transitions call + bulk_transition_issues)
           - Field updates: Bulk edit API (only for tickets that succeeded status transition)
        2. Updates local database for successfully updated tickets


        All update fields are optional. Only provided fields will be updated.


        Performance: Returns immediately; processing happens asynchronously
      operationId: bulk_update_tickets
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ITSMTicketBulkUpdateRequestModel'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponseModel'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - API-Key: []
          Connection-ID: []
components:
  schemas:
    ITSMTicketBulkUpdateRequestModel:
      properties:
        ticket_ids:
          description: List of ticket IDs to update (1-50 items)
          items:
            format: uuid
            type: string
          maxItems: 50
          minItems: 1
          title: Ticket Ids
          type: array
        updates:
          $ref: '#/components/schemas/ITSMTicketUpdateRequestModel'
          description: Fields to update (same for all tickets)
      required:
        - ticket_ids
        - updates
      title: ITSM Ticket Bulk Update Request
      type: object
    JobResponseModel:
      description: Response model for job creation endpoints that return a job ID.
      properties:
        job_id:
          description: Job ID for tracking async operation status
          title: Job Id
          type: string
      required:
        - job_id
      title: JobResponseModel
      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
    ITSMTicketUpdateRequestModel:
      properties:
        assigned_user_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: User ID assigned to the Ticket
          title: Assigned User Id
        comments:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Public-facing comments visible to end users. ServiceNow: maps to
            'comments'. Ignored for Jira.
          title: Comments
        description:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Description of the Ticket. Accepts plain text or an Atlassian
            Document Format (ADF) document — an object, or that object
            serialized to a string — for rich text such as headings, bold and
            code blocks. ADF is passed to Jira unchanged; plain text is wrapped
            for you. Vendors that store plain text (e.g. ServiceNow) receive the
            flattened text.
          title: Description
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: Name/Title of the Ticket
          title: Name
        priority:
          anyOf:
            - type: string
            - type: 'null'
          description: Priority of the Ticket
          title: Priority
        resolution_notes:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Detailed explanation of resolution. ServiceNow: maps to
            'close_notes'. Ignored for Jira.
          title: Resolution Notes
        resolution_reason:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Category/reason for resolution. ServiceNow: maps to 'close_code'.
            Ignored for Jira.
          title: Resolution Reason
        status:
          anyOf:
            - type: string
            - type: 'null'
          description: Status of the Ticket
          title: Status
        status_change_reason:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Reason for a status change (e.g. reason for putting on hold).
            ServiceNow: maps to 'hold_reason'. Ignored for Jira.
          title: Status Change Reason
        work_notes:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Internal work notes visible only to agents. ServiceNow: maps to
            'work_notes'. Ignored for Jira.
          title: Work Notes
      title: ITSM Ticket Update Request
      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.