{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currents-dev/json-schema/currents-dev-link-jira-issue-from-run-test-request-schema.json",
  "title": "LinkJiraIssueFromRunTestRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/currents-dev-openapi.yml#/components/schemas/LinkJiraIssueFromRunTestRequest",
  "type": "object",
  "required": [
    "runId",
    "testId",
    "jiraInstallationId",
    "jiraProjectId",
    "jiraIssueType"
  ],
  "properties": {
    "runId": {
      "type": "string",
      "minLength": 1,
      "description": "Currents run ID containing the test"
    },
    "testId": {
      "type": "string",
      "minLength": 1,
      "description": "Test ID within the run (client test id)"
    },
    "jiraInstallationId": {
      "type": "string",
      "minLength": 1,
      "description": "Atlassian Jira installation ID for the org integration (same as Installation ID in the dashboard)"
    },
    "jiraProjectId": {
      "type": "string",
      "minLength": 1,
      "description": "Jira project ID for the linked issue"
    },
    "jiraIssueType": {
      "type": "string",
      "minLength": 1,
      "description": "Jira issue type identifier stored on the Currents ticket (same as `jiraIssueType` when creating issues; use issue type discovery when unsure)"
    },
    "comment": {
      "type": "string",
      "description": "Optional text prepended to the Jira comment and Currents issue description before the automated test context (when `includeContextInComment` is true)"
    },
    "includeContextInComment": {
      "type": "boolean",
      "default": true,
      "description": "When true (default), appends the same automated test context used when creating Jira issues from a run test. When false, `comment` must be non-empty and is used alone for the Jira comment and issue description."
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "includeContextInComment": {
            "const": false
          }
        },
        "required": [
          "includeContextInComment"
        ]
      },
      "then": {
        "required": [
          "comment"
        ],
        "properties": {
          "comment": {
            "type": "string",
            "minLength": 1,
            "description": "Required when `includeContextInComment` is false; used alone for the Jira comment and issue description"
          }
        }
      }
    }
  ]
}