> ## 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:
  - url: https://api.leen.dev/v1
    description: Production API
  - url: https://api.eu-c1.leen.dev/v1
    description: Production API (EU Region)
  - url: https://api.ap-se2.leen.dev/v1
    description: Production Api (APAC Region)
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:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ITSMTicketBulkUpdateRequestModel'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponseModel'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - Connection-ID: []
          API-Key: []
components:
  schemas:
    ITSMTicketBulkUpdateRequestModel:
      properties:
        ticket_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 50
          minItems: 1
          title: Ticket Ids
          description: List of ticket IDs to update (1-50 items)
        updates:
          allOf:
            - $ref: '#/components/schemas/ITSMTicketUpdateRequestModel'
          description: Fields to update (same for all tickets)
      type: object
      required:
        - ticket_ids
        - updates
      title: ITSM Ticket Bulk Update Request
    JobResponseModel:
      properties:
        job_id:
          type: string
          title: Job Id
          description: Job ID for tracking async operation status
      type: object
      required:
        - job_id
      title: JobResponseModel
      description: Response model for job creation endpoints that return a job ID.
    ErrorResponse:
      properties:
        type:
          type: string
          title: Type
          description: Type of error
        code:
          type: string
          title: Code
          description: Error code
        message:
          type: string
          title: Message
          description: Error message
        detail:
          items:
            type: object
          type: array
          title: Detail
          description: List of error dictionaries
      type: object
      required:
        - type
        - code
        - message
        - detail
      title: ErrorResponse
    ITSMTicketUpdateRequestModel:
      properties:
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Status of the Ticket
        priority:
          anyOf:
            - type: string
            - type: 'null'
          title: Priority
          description: Priority of the Ticket
        assigned_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Assigned User Id
          description: User ID assigned to the Ticket
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name/Title of the Ticket
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the Ticket
      type: object
      title: ITSM Ticket Update Request
  securitySchemes:
    Connection-ID:
      type: apiKey
      in: header
      name: X-CONNECTION-ID
    API-Key:
      type: apiKey
      in: header
      name: X-API-KEY

````