Overview
The ITSM Write Endpoints feature allows you to programmatically create and update tickets in your connected IT Service Management (ITSM) systems directly through the Leen API. This enables powerful automation and workflow integration, allowing you to manage your ITSM resources without leaving your development environment. By using the ticket write endpoints, you can build integrations that:- Automatically create bug reports from CI/CD pipeline failures.
- Generate tasks based on security alerts from other tools.
- Keep ticket statuses synchronized with your internal systems.
- Bulk-create tickets synchronously and get per-ticket results immediately.
Supported Integrations and Operations
The availability of write operations depends on the specific ITSM connector.Creating Tickets
When creating a ticket viaPOST /itsm/tickets, you can identify the target project, issue type, assignee, and parent ticket using either Leen UUIDs (from a prior sync) or vendor IDs (directly from the vendor system). The two forms are mutually exclusive per field.
Using vendor IDs skips extra database lookups, which is useful when you have vendor data on hand and want to avoid a round-trip sync.
ServiceNow
ServiceNow organises tickets by table rather than by project. When creating a ServiceNow ticket:project_id/project_vendor_idare not required. The target table (incidentorproblem) is derived automatically fromtype.typemust be"Incident"or"Problem".- Use the
assigned_user_vendor_idfield with the user’ssys_id(returned by List Assignable Users (Passthrough)).
Bulk Create Tickets (Sync)
POST /itsm/tickets/bulk/sync creates tickets synchronously using the vendor’s bulk create API and returns per-ticket results immediately — no job polling required.
The response includes a summary and a results array in request order:
project_vendor_id, assigned_user_vendor_id, etc.), local DB persistence is skipped and ticket_id will be null in the response. The created tickets will appear after the next connector sync.
Batch size is capped at the same limit as async bulk create.
Passthrough Endpoints
Passthrough endpoints proxy requests directly to the vendor API, bypassing Leen’s normalized data store. They are useful for populating dropdowns and search UIs when configuring ticket creation — for example, to let users pick a project, issue type, or assignee without waiting for a full sync. All passthrough endpoints require aconnection_id scoped to a supported vendor (Jira or ServiceNow ITSM). Vendor IDs returned by passthrough endpoints can be used directly in the _vendor_id fields of ticket create requests.
List Projects
limit, offset).
Each project includes a vendor_id, name, project_type, and optionally an embedded list of issue_types.
- Jira:
vendor_idis the project key (e.g.PROJ). - ServiceNow: always returns two items —
vendor_id: "incident"andvendor_id: "problem"— representing the available ticket tables.
List Issue Types
project_key is the vendor project identifier — use vendor_id from the List Projects response.
Each result includes a vendor_id that can be passed as type_vendor_id when creating a ticket.
- Jira:
vendor_idis the Jira issue type ID (e.g.10034). - ServiceNow: this endpoint returns
404. ServiceNow does not use issue types — passtype = "Incident"ortype = "Problem"directly when creating a ticket.
List Assignable Users
query parameter to filter by name or email.
Each result includes a vendor_id that can be passed as assigned_user_vendor_id when creating a ticket. Total count may be null depending on the vendor.
- Jira:
vendor_idis the JiraaccountId.queryfilters by display name or email. - ServiceNow:
vendor_idis the usersys_id.project_keyis ignored — all active users are assignable to any table.queryfilters by display name or username (case-insensitive contains). Total count is alwaysnull.
Search Tickets
-
Jira: use the
jqlquery parameter with standard JQL syntax. Supports cursor-based pagination viacursorandlimit(1–100, default 50). Thenext_cursorfield in the response can be passed ascursorin the next request. -
ServiceNow: use the
tableparameter (incidentorproblem, defaultincident) and thequeryparameter with ServiceNow encoded query syntax (sysparm_query). Supports offset pagination vialimitandoffset.