{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/strix-ai/json-schema/strix-ai-ticketing-integration-settings-schema.json",
  "title": "TicketingIntegrationSettings",
  "description": "Ticketing settings for a Linear or Jira integration.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/strix-ai-openapi.json#/components/schemas/TicketingIntegrationSettings",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "provider": {
      "type": "string",
      "enum": [
        "linear",
        "jira"
      ]
    },
    "status": {
      "type": "string"
    },
    "status_detail": {
      "type": [
        "string",
        "null"
      ]
    },
    "auto_sync_enabled": {
      "type": "boolean"
    },
    "issue_label_enabled": {
      "type": "boolean"
    },
    "issue_label_name": {
      "type": "string"
    },
    "auto_sync_min_severity": {
      "type": "string",
      "enum": [
        "critical",
        "high",
        "medium",
        "low"
      ]
    },
    "auto_sync_sources": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "scan",
          "supply_chain"
        ]
      },
      "description": "Finding sources that auto-sync creates tickets for: `scan` (pentest findings) and `supply_chain` (dependency CVEs). PR-review findings never auto-sync. Manual, bulk, and API pushes ignore this."
    },
    "auto_sync_reachability": {
      "type": "string",
      "enum": [
        "all",
        "reachable_only"
      ],
      "description": "Which dependency findings auto-create tickets. `all` (the default) tickets every dependency finding; `reachable_only` tickets only the findings whose vulnerable code the scan proved runs. Pentest findings ignore this."
    },
    "default_collection_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "default_collection_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "default_ticket_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "jira_field_values": {
      "type": "object",
      "additionalProperties": true
    },
    "source_routes": {
      "$ref": "#/$defs/TicketingSourceRoutes"
    },
    "default_assignee_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Provider user ID that new tickets are assigned to. Linear: user ID. Jira Cloud: `accountId`. Jira Server: username. `null` leaves tickets unassigned."
    },
    "default_assignee_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Display name of the default assignee."
    },
    "title_template": {
      "type": [
        "string",
        "null"
      ],
      "description": "Template for the ticket title. Placeholders use `{{name}}`: `title`, `severity`, `cve`, `cvss`, `target`, `endpoint`, `repository`, `pentest`, `source`, `strix_url`, `details`. `null` means `{{title}}`."
    },
    "description_template": {
      "type": [
        "string",
        "null"
      ],
      "description": "Template for the ticket description. Same placeholders as `title_template`. `null` means `{{details}}`."
    },
    "group_by_pentest": {
      "type": "boolean",
      "description": "When true, Strix creates one grouping object per pentest and files its tickets under it: a Linear project in the destination team, or a Jira Epic in the destination project."
    },
    "jira_priority_map": {
      "type": [
        "object",
        "null"
      ],
      "description": "Jira only: maps each severity (`critical`, `high`, `medium`, `low`) to a Jira priority `{ id, name }` or `null` (Jira's default). `null` disables the mapping; Linear priority always follows severity."
    },
    "due_date_days": {
      "type": [
        "object",
        "null"
      ],
      "description": "Maps each severity to a whole number of days (1-365) after ticket creation for the due date, or `null` (no due date). `null` disables. Applies to Linear and Jira; a snooze date always wins."
    },
    "repositories": {
      "type": "array",
      "description": "Connected repositories that a repository route can target. Present for administrators and service tokens.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Repository identifier."
          },
          "full_name": {
            "type": "string",
            "description": "Repository full name, for example `acme/api`."
          },
          "provider": {
            "type": "string",
            "description": "Source control provider."
          }
        },
        "required": [
          "id",
          "full_name",
          "provider"
        ]
      }
    },
    "repository_routes": {
      "type": "array",
      "description": "Ticket destination for each routed repository. Present for administrators and service tokens.",
      "items": {
        "$ref": "#/$defs/TicketingRepositoryRoute"
      }
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "provider",
    "status",
    "status_detail",
    "auto_sync_enabled",
    "issue_label_enabled",
    "issue_label_name",
    "auto_sync_min_severity",
    "auto_sync_sources",
    "auto_sync_reachability",
    "default_collection_id",
    "default_collection_name",
    "default_ticket_type",
    "jira_field_values",
    "created_at"
  ],
  "$defs": {
    "TicketingRepositoryRoute": {
      "type": "object",
      "description": "Destination for findings from one repository. A repository route has priority over a source route.",
      "allOf": [
        {
          "$ref": "#/$defs/TicketingSourceRoute"
        },
        {
          "type": "object",
          "properties": {
            "repository_id": {
              "type": "string",
              "description": "Repository identifier."
            },
            "project_id": {
              "type": "string",
              "description": "Same value as `collection_id`. Deprecated, read `collection_id`.",
              "deprecated": true
            },
            "project_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Same value as `collection_name`. Deprecated, read `collection_name`.",
              "deprecated": true
            }
          },
          "required": [
            "repository_id"
          ]
        }
      ]
    },
    "TicketingSourceRoute": {
      "type": "object",
      "description": "Destination that receives tickets for one routing rule. For Linear, the destination is a team or a project. For Jira, the destination is a project with an optional issue type and required field values.",
      "properties": {
        "collection_id": {
          "type": "string",
          "description": "Linear team or project identifier, or Jira project identifier."
        },
        "collection_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Destination name."
        },
        "ticket_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "Jira issue type for this rule. If null, Strix uses the project default. Always null for Linear."
        },
        "jira_field_values": {
          "type": "object",
          "additionalProperties": true,
          "description": "Jira required field values for this rule, keyed by field. Each value is `{ value, label }`. Always empty for Linear."
        }
      },
      "required": [
        "collection_id"
      ]
    },
    "TicketingSourceRoutes": {
      "type": "object",
      "description": "The destination for each finding source, keyed by `scan` (pentests), `pr_review`, and `supply_chain`. Applies to Linear and Jira. If a key is missing, Strix uses the default destination for that source. A repository route has priority over a source route.",
      "properties": {
        "scan": {
          "$ref": "#/$defs/TicketingSourceRoute"
        },
        "pr_review": {
          "$ref": "#/$defs/TicketingSourceRoute"
        },
        "supply_chain": {
          "$ref": "#/$defs/TicketingSourceRoute"
        }
      },
      "additionalProperties": false
    }
  }
}