openapi: 3.2.0 info: title: Test Observer Issues API description: Test Observer API (see https://github.com/canonical/test_observer) license: name: GNU Affero General Public License v3 url: https://raw.githubusercontent.com/canonical/test_observer/refs/heads/main/backend/LICENSE version: 0.1.0 tags: - name: Issues paths: /v1/issues/{issue_id}/attach: post: tags: - Issues summary: Add Issue Attachments operationId: add_issue_attachments_v1_issues__issue_id__attach_post parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/IssueAttachmentRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/IssueResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_issue_attachment - change_issue_attachment_bulk /v1/issues/{issue_id}/detach: post: tags: - Issues summary: Remove Issue Attachments operationId: remove_issue_attachments_v1_issues__issue_id__detach_post parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/IssueAttachmentRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/IssueResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_issue_attachment - change_issue_attachment_bulk /v1/issues/{issue_id}/attachment-rules: post: tags: - Issues summary: Post Attachment Rule operationId: post_attachment_rule_v1_issues__issue_id__attachment_rules_post parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/IssueTestResultAttachmentRulePostRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MinimalIssueTestResultAttachmentRuleResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_attachment_rule /v1/issues/{issue_id}/attachment-rules/{attachment_rule_id}: patch: tags: - Issues summary: Patch Attachment Rule operationId: patch_attachment_rule_v1_issues__issue_id__attachment_rules__attachment_rule_id__patch parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id - name: attachment_rule_id in: path required: true schema: type: integer title: Attachment Rule Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/IssueTestResultAttachmentRulePatchRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MinimalIssueTestResultAttachmentRuleResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_attachment_rule delete: tags: - Issues summary: Delete Attachment Rule operationId: delete_attachment_rule_v1_issues__issue_id__attachment_rules__attachment_rule_id__delete parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id - name: attachment_rule_id in: path required: true schema: type: integer title: Attachment Rule Id responses: '204': description: Successful Response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_attachment_rule /v1/issues: get: tags: - Issues summary: Get Issues operationId: get_issues_v1_issues_get parameters: - name: source in: query required: false schema: anyOf: - $ref: '#/components/schemas/IssueSource' - type: 'null' description: Filter by issue source (e.g., github, jira, launchpad) title: Source description: Filter by issue source (e.g., github, jira, launchpad) - name: project in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by project name title: Project description: Filter by project name - name: status in: query required: false schema: anyOf: - type: array items: $ref: '#/components/schemas/IssueStatus' - type: 'null' description: Filter by issue status. Accepts multiple values title: Status description: Filter by issue status. Accepts multiple values - name: families in: query required: false schema: anyOf: - type: array items: $ref: '#/components/schemas/FamilyName' - type: 'null' description: Filter by artefact family (e.g., snap, deb, charm, image) title: Families description: Filter by artefact family (e.g., snap, deb, charm, image) - name: limit in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: 'Maximum number of results to return (default: 50)' default: 50 title: Limit description: 'Maximum number of results to return (default: 50)' - name: offset in: query required: false schema: type: integer minimum: 0 description: 'Number of results to skip for pagination (default: 0)' default: 0 title: Offset description: 'Number of results to skip for pagination (default: 0)' - name: q in: query required: false schema: anyOf: - type: string - type: 'null' description: Search term for issue source, project, keys, title, and status title: Q description: Search term for issue source, project, keys, title, and status responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/IssuesGetResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_issue put: tags: - Issues summary: Create Or Update Issue operationId: create_or_update_issue_v1_issues_put requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/IssuePutRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/IssueResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_issue /v1/issues/{issue_id}: get: tags: - Issues summary: Get Issue operationId: get_issue_v1_issues__issue_id__get parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/IssueResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_issue patch: tags: - Issues summary: Patch Issue operationId: patch_issue_v1_issues__issue_id__patch parameters: - name: issue_id in: path required: true schema: type: integer title: Issue Id - name: title in: query required: false schema: anyOf: - type: string - type: 'null' title: Title - name: status in: query required: false schema: anyOf: - $ref: '#/components/schemas/IssueStatus' - type: 'null' title: Status - name: auto_rerun_enabled in: query required: false schema: anyOf: - type: boolean - type: 'null' title: Auto Rerun Enabled requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/IssuePatchRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/IssueResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_issue - change_auto_rerun components: schemas: IssuePutRequest: properties: title: anyOf: - type: string - type: 'null' title: Title status: anyOf: - $ref: '#/components/schemas/IssueStatus' - type: 'null' auto_rerun_enabled: anyOf: - type: boolean - type: 'null' title: Auto Rerun Enabled url: type: string maxLength: 2083 minLength: 1 format: uri title: Url type: object required: - url title: IssuePutRequest ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError MinimalIssueTestResultAttachmentRuleResponse: properties: id: type: integer title: Id enabled: type: boolean title: Enabled families: items: $ref: '#/components/schemas/FamilyName' type: array title: Families artefacts: items: type: string type: array title: Artefacts artefact_versions: items: type: string type: array title: Artefact Versions artefact_stages: items: type: string type: array title: Artefact Stages artefact_tracks: items: type: string type: array title: Artefact Tracks environment_names: items: type: string type: array title: Environment Names test_plans: items: type: string type: array title: Test Plans test_case_names: items: type: string type: array title: Test Case Names template_ids: items: type: string type: array title: Template Ids test_result_statuses: items: $ref: '#/components/schemas/TestResultStatus' type: array title: Test Result Statuses execution_metadata: $ref: '#/components/schemas/ExecutionMetadata' type: object required: - id - enabled - families - artefacts - artefact_versions - artefact_stages - artefact_tracks - environment_names - test_plans - test_case_names - template_ids - test_result_statuses - execution_metadata title: MinimalIssueTestResultAttachmentRuleResponse IssuesGetResponse: properties: issues: items: $ref: '#/components/schemas/MinimalIssueResponse' type: array title: Issues count: type: integer title: Count limit: type: integer title: Limit offset: type: integer title: Offset type: object required: - issues - count - limit - offset title: IssuesGetResponse IssueTestResultAttachmentRulePostRequest: properties: enabled: type: boolean title: Enabled default: true families: items: $ref: '#/components/schemas/FamilyName' type: array title: Families artefacts: items: type: string type: array title: Artefacts artefact_versions: items: type: string type: array title: Artefact Versions artefact_stages: items: type: string type: array title: Artefact Stages artefact_tracks: items: type: string type: array title: Artefact Tracks environment_names: items: type: string type: array title: Environment Names test_plans: items: type: string type: array title: Test Plans test_case_names: items: type: string type: array title: Test Case Names template_ids: items: type: string type: array title: Template Ids test_result_statuses: items: $ref: '#/components/schemas/TestResultStatus' type: array title: Test Result Statuses execution_metadata: $ref: '#/components/schemas/ExecutionMetadata' type: object title: IssueTestResultAttachmentRulePostRequest ExecutionMetadata: additionalProperties: items: type: string maxLength: 200 minLength: 1 description: Execution Metadata Value type: array propertyNames: maxLength: 200 minLength: 1 description: Execution Metadata Category type: object title: Execution Metadata description: A mapping of string categories to lists of string values. examples: - charm: - postgresql-k8s - mysql-k8s charm:postgresql-k8s:revision: - '495' IssueStatus: type: string enum: - unknown - open - closed title: IssueStatus IssuePatchRequest: properties: title: anyOf: - type: string - type: 'null' title: Title status: anyOf: - $ref: '#/components/schemas/IssueStatus' - type: 'null' auto_rerun_enabled: anyOf: - type: boolean - type: 'null' title: Auto Rerun Enabled type: object title: IssuePatchRequest IssueAttachmentRequest: properties: test_results: anyOf: - items: type: integer type: array - type: 'null' title: Test Results test_results_filters: anyOf: - $ref: '#/components/schemas/TestResultSearchFilters' - type: 'null' attachment_rule: anyOf: - type: integer - type: 'null' title: Attachment Rule type: object title: IssueAttachmentRequest TestResultStatus: type: string enum: - PASSED - FAILED - SKIPPED title: TestResultStatus FamilyName: type: string enum: - snap - deb - charm - image - solution title: FamilyName TestResultSearchFilters: properties: families: items: $ref: '#/components/schemas/FamilyName' type: array title: Families artefacts: items: type: string type: array title: Artefacts artefact_versions: items: type: string type: array title: Artefact Versions artefact_stages: items: type: string type: array title: Artefact Stages artefact_tracks: items: type: string type: array title: Artefact Tracks artefact_is_archived: anyOf: - type: boolean - type: 'null' title: Artefact Is Archived environments: items: type: string type: array title: Environments test_cases: items: type: string type: array title: Test Cases template_ids: items: type: string type: array title: Template Ids test_plans: items: type: string type: array title: Test Plans execution_metadata: $ref: '#/components/schemas/ExecutionMetadata' issues: anyOf: - items: type: integer type: array - type: string enum: - any - none title: Issues test_result_statuses: items: $ref: '#/components/schemas/TestResultStatus' type: array title: Test Result Statuses test_execution_statuses: items: $ref: '#/components/schemas/TestExecutionStatus' type: array title: Test Execution Statuses reviewer_ids: anyOf: - items: type: integer type: array - type: string enum: - any - none title: Reviewer Ids assignee_ids: anyOf: - items: type: integer type: array - type: string enum: - any - none - type: 'null' title: Assignee Ids deprecated: true rerun_is_requested: anyOf: - type: boolean - type: 'null' title: Rerun Is Requested execution_is_latest: anyOf: - type: boolean - type: 'null' title: Execution Is Latest from_date: anyOf: - type: string format: date-time - type: 'null' title: From Date until_date: anyOf: - type: string format: date-time - type: 'null' title: Until Date offset: anyOf: - type: integer - type: 'null' title: Offset limit: anyOf: - type: integer - type: 'null' title: Limit type: object title: TestResultSearchFilters IssueTestResultAttachmentRulePatchRequest: properties: enabled: anyOf: - type: boolean - type: 'null' title: Enabled type: object title: IssueTestResultAttachmentRulePatchRequest HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError IssueResponse: properties: id: type: integer title: Id source: $ref: '#/components/schemas/IssueSource' project: type: string title: Project key: type: string title: Key title: type: string title: Title status: $ref: '#/components/schemas/IssueStatus' url: type: string maxLength: 2083 minLength: 1 format: uri title: Url labels: anyOf: - items: type: string type: array - type: 'null' title: Labels auto_rerun_enabled: type: boolean title: Auto Rerun Enabled attachment_rules: items: $ref: '#/components/schemas/MinimalIssueTestResultAttachmentRuleResponse' type: array title: Attachment Rules type: object required: - id - source - project - key - title - status - url - auto_rerun_enabled - attachment_rules title: IssueResponse TestExecutionStatus: type: string enum: - NOT_STARTED - IN_PROGRESS - PASSED - FAILED - NOT_TESTED - ENDED_PREMATURELY title: TestExecutionStatus MinimalIssueResponse: properties: id: type: integer title: Id source: $ref: '#/components/schemas/IssueSource' project: type: string title: Project key: type: string title: Key title: type: string title: Title status: $ref: '#/components/schemas/IssueStatus' url: type: string maxLength: 2083 minLength: 1 format: uri title: Url labels: anyOf: - items: type: string type: array - type: 'null' title: Labels test_executions_count: type: integer title: Test Executions Count default: 0 type: object required: - id - source - project - key - title - status - url title: MinimalIssueResponse IssueSource: type: string enum: - jira - github - launchpad title: IssueSource