Integrations
How to read, search and create issues in a project's integrations using the public API
QA Sphere integrates natively with Jira, GitHub and Linear, and any other issue tracker can be added as a custom integration. With an integration, testers create issues from within QA Sphere while running tests, with the test case's details filled in, and link them to the results they found, so each issue stays traceable to its tests. See the integrations overview for how integrations work and how to set them up.
Test runs, test plans and requirements can also be linked to one issue in the project's Jira or Linear integration, with integrationIssueId in Create New Run, Create New Test Plan, Create Requirement or their update endpoints. QA Sphere then adds a link back on the issue, which shows a run's or test plan's progress and stays up to date.
These endpoints list a project's integrations, and read, search and create issues in its Jira, GitHub or Linear integration. A custom integration only holds links, so it has no issue endpoints. Integrations are set up and linked to projects in QA Sphere's UI; the API can't create, link or remove them.
- Any member of the project can list its integrations. Reading, searching and creating issues needs role Test Runner or higher.
- Only issues in the linked Jira project, GitHub repository or Linear team are found. Others return
404 Not Found. - When the tracker refuses a request, the response's message gives the tracker's reason, and its status is one of these:
400 Bad Request: the tracker rejected the input, such as a missing required Jira field.404 Not Found: the issue, or the Jira issue type, that the path names doesn't exist.409 Conflict: the tracker refused the integration's access, can't find the linked Jira project, GitHub repository or Linear team, or the GitHub repository has issues turned off. An admin reconnects or relinks the integration in QA Sphere's UI.502 Bad Gateway: the tracker failed, or answered in a way QA Sphere doesn't expect.
Linking Issues to Results
A result links issues in the project's integration. Pass them in links when you add a result or several, or add them to an existing result with createLinks in Update Result. Link an existing issue (find it with the get and search endpoints below), or create one first and link the created issue. Each link takes:
{
integrationId: string // ID of an integration linked to the project
url: string // URL of the issue, such as its `url` below (http or https, max 255 characters)
text?: string // Title of the issue
meta?: { // Required for Jira, GitHub and Linear links; the only key it takes is id
id: string // Jira: issue ID or key (`10394`, `QA-12`); GitHub: issue number (`123`); Linear: issue ID or identifier (`ENG-34`)
}
}A custom integration's links don't need meta. Jira and Linear links are saved with the issue's ID, even when meta.id is a key or identifier.
The link's integration must be linked to the project. A link, added with a new result or with Update Result, puts a reference back on the issue (a comment and, additionally in Jira, a link to the run test case), so its issue must be in the linked Jira project, GitHub repository or Linear team. Only a result's author can update it.
Integration Object
{
id: string // Integration ID, as the issue endpoints take it
name: string // Name of the integration
type: string // Integration type (`jira` | `github` | `linear` | `custom`)
config: object // Tracker details, by type (see below)
relationConfig: object // What the project is linked to, by type (see below)
}type | config | relationConfig |
|---|---|---|
jira | { url: string }: the Jira site | { projectId: string, projectName: string } |
github | { org: string }: the GitHub account | { repo: string } |
linear | { organizationUrlKey?: string, isExpired?: true } | { teamId: string, teamName: string } |
custom | { newLink: string, viewLink: string }: the New Issue Link and the Title Extraction Rule | { params?: { project: string } } (see below) |
config never holds any credentials. isExpired means the Linear authorization has expired: until an admin reauthorizes the integration in QA Sphere's UI, its issue endpoints return 409 Conflict.
A custom integration's links can contain a $(project) parameter, which QA Sphere replaces with a value set separately for each linked project. params.project is this project's value: it is asked for when the integration is linked to the project, and can be changed later in the integration settings. See Per-Project Parameter.
List Integrations
Lists the integrations linked to the project, sorted by name. A project links only a few, so the list isn't paginated; today it links at most one.
Response
Status: 200 OK
{
integrations: Integration[] // See Integration Object
}Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/integrationExample Response
{
"integrations": [
{
"id": "1CSWAh3ys_YniqfXepnwT8F",
"name": "Acme Jira",
"type": "jira",
"config": { "url": "https://acme.atlassian.net" },
"relationConfig": { "projectId": "10000", "projectName": "QA" }
}
]
}Get Integration
Returns one integration linked to the project, as List Integrations does.
Response
Status: 200 OK
Integration // See Integration Object; the object itself, not wrapped in anotherErrors
| Status Code | Description |
|---|---|
| 404 | The project isn't linked to the integration |
Jira
The Jira endpoints are under /api/public/v0/project/{project_id}/integration/jira/{integration_id}, and take only a Jira integration linked to the project. Any other ID returns 404 Not Found.
Jira Issue Object
{
id: string // Jira issue ID (e.g. `10394`)
key: string // Issue key (e.g. `QA-12`); it changes if the issue moves to another Jira project
summary: string // Title of the issue
description: string // Description in Jira's text format
url: string // URL of the issue in Jira
}Get Jira Issue
Returns an issue, by its numeric ID or its key (e.g. QA-12). Anything else returns 404 Not Found.
Response
Status: 200 OK
{
issue: JiraIssue // See Jira Issue Object
}Search Jira Issues
Searches the issues of the linked Jira project.
Cursor paging
Jira pages its search by cursor only, so this endpoint takes nextPageToken instead of offset and reports no total. Pass each response's nextPageToken to get the next page, until isLast is true.
Query Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
search | string | Words the issue titles start with, or an issue key or number (1–255 characters). | No filter | search=login |
types | string | Issue type names. Repeat the parameter for multiple values. | No filter | types=Bug |
fields | string | Jira fields to fetch. Accepted values: summary or description. Repeat the parameter for multiple values. | summary | fields=description |
nextPageToken | string | nextPageToken of the previous page. | First page | nextPageToken=Ch0j… |
limit | number | Maximum number of items to return. Accepted range: 1–250. | 20 | limit=50 |
sortField | string | Field to sort by: created, updated, priority, status, key, summary or issuetype. | created | sortField=key |
sortOrder | string | Sort direction for sortField: asc or desc. Without sortField, the newest issues come first. | asc | sortOrder=desc |
Response
Status: 200 OK
{
data: JiraIssue[] // See Jira Issue Object; only `id`, `key`, `url` and the fields named in `fields` are filled in
nextPageToken: string | null // Token for the next page, null on the last page
isLast: boolean // Whether this is the last page
}Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
"https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/integration/jira/1CSWAh3ys_YniqfXepnwT8F/issue?search=login&sortField=key&sortOrder=desc"List Jira Issue Types
Lists the issue types of the linked Jira project, for Create Jira Issue.
Response
Status: 200 OK
{
issueTypes: Array<{ // Issue types of the linked Jira project
id: string // Issue type ID
name: string // Name of the issue type (e.g. Bug)
description: string // Description of the issue type
subtask: boolean // Whether issues of this type need a parent
hierarchyLevel: number // `1` for epics, `0` for standard types such as stories and bugs, `-1` for sub-tasks
}>
}Get Jira Issue Fields
Lists the fields an issue type takes, as Jira describes them. issue_type_id is the numeric ID that List Jira Issue Types returns; anything else returns 404 Not Found. Required fields other than summary, description, issuetype, parent, project and reporter go in otherFields when you create an issue.
Response
Status: 200 OK
{
fields: Array<{ // Fields of the issue type
fieldId: string // Jira's ID of the field (e.g. `summary` or `customfield_10010`)
key: string // Key for `otherFields`
name: string // Name of the field, as Jira shows it
schema: { // Type of the field's value
type: string // Value type (e.g. `string`, `number`, `option`, `array` or `user`)
items: string // Type of the items of an `array` field; empty for other types
systemName: string // Name of a built-in Jira field (e.g. `labels`); empty for a custom field
customFieldId: number // Number of a custom field (e.g. `10010`); `0` for a built-in field
customFieldTypeId: string // Type of a custom field (e.g. `com.atlassian.jira.plugin.system.customfieldtypes:float`); empty for a built-in field
}
required: boolean // Whether Jira needs a value to create the issue
operations: string[] // How the field's value can be changed: `set`, and `add` and `remove` for an array
allowedValues: any[] // Values the field accepts, when Jira lists them
autoCompleteUrl: string // Jira URL that suggests values for the field; empty when there is none
autoCompleteUrlResponse: any // What `autoCompleteUrl` returned when QA Sphere fetched it; null when it wasn't fetched
hasDefaultValue: boolean // Whether the field has a default value
defaultValue: any // The field's default value, null when it has none
}>
}Create Jira Issue
Creates an issue in the linked Jira project. To link it to a test result, see Linking Issues to Results.
The issue is filed under your own Jira account if you have connected it to QA Sphere, and under the integration's account if you haven't, or if your account can't create issues in the Jira project. If your connection has expired or was revoked, issues are filed under the integration's account unless you reauthenticate from QA Sphere's UI. createdAs in the response says which account filed it.
Request Body
Send JSON, or multipart/form-data to attach files.
{
summary: string // Title, up to 255 characters (Jira counts emoji as two)
description?: string // Description in Jira's text format, up to 32,767 characters (emoji count as two)
issueTypeId: string // See List Jira Issue Types
parentId?: string // ID of the parent issue, which sub-task types need
otherFields?: object // Other fields by key, in Jira's REST API format (see Get Jira Issue Fields)
}otherFields can't set summary, description, issuetype, parent, project or reporter: those come from the fields above and the linked Jira project, and a request that sets one fails with 400 Bad Request.
With multipart/form-data, each field above is a form field (otherFields as a JSON string), and up to 5 files go in attachments fields: 100 MiB each, 250 MiB in all. Jira stores them on the issue.
Response
Status: 201 Created
{
id: string // Jira issue ID
key: string // Issue key (e.g. `QA-12`)
url: string // URL of the issue in Jira
attachmentUploadErrors: string[] | null // Attachments Jira refused; the issue is created anyway
createdAs: string // `user` (your Jira account) | `integration` (the integration's account)
}Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"summary": "Login fails with a valid password",
"description": "Steps: open the login page, enter valid credentials, submit.",
"issueTypeId": "10001",
"otherFields": { "priority": { "name": "High" } }
}' \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/integration/jira/1CSWAh3ys_YniqfXepnwT8F/issueExample Response
{
"id": "10394",
"key": "QA-12",
"url": "https://acme.atlassian.net/browse/QA-12",
"attachmentUploadErrors": null,
"createdAs": "integration"
}GitHub
The GitHub endpoints are under /api/public/v0/project/{project_id}/integration/github/{integration_id}, and take only a GitHub integration linked to the project. GitHub issues can't be searched.
Get GitHub Issue
Returns an issue of the linked repository, by its number. A pull request's number returns 404 Not Found, since results can't link pull requests.
Response
Status: 200 OK
{
issue: { // The issue
id: number // GitHub's internal ID of the issue, not its number
number: number // Issue number in the repository, which a result link's `meta.id` takes
title: string // Title of the issue
body: string // Description, in Markdown
url: string // URL of the issue on GitHub
}
}Create GitHub Issue
Creates an issue in the linked repository, as the integration's GitHub App.
Request Body
Send JSON, or multipart/form-data to attach files.
{
summary: string // Title (1–255 characters)
description?: string // Description in Markdown (up to 32,767 characters)
}With multipart/form-data, up to 5 files go in attachments fields (100 MiB each, 250 MiB in all). GitHub's API takes no attachments, so QA Sphere stores the files and appends links to them to the description; opening them needs a QA Sphere login.
Response
Status: 201 Created
{
id: number // GitHub's internal ID of the issue, not its number
number: number // Issue number in the repository, which a result link's `meta.id` takes
url: string // URL of the issue on GitHub
}Linear
The Linear endpoints are under /api/public/v0/project/{project_id}/integration/linear/{integration_id}, and take only a Linear integration linked to the project. They return 409 Conflict while the integration's authorization has expired.
Linear Issue Object
{
id: string // Linear issue ID
identifier: string // Issue identifier (e.g. `ENG-34`)
title: string // Title of the issue
url: string // URL of the issue in Linear
}Get Linear Issue
Returns an issue of the linked team, by its ID or identifier.
Response
Status: 200 OK
{
issue: LinearIssue // See Linear Issue Object
}Search Linear Issues
Searches the issues of the linked team.
Cursor paging
Linear pages by cursor only, so this endpoint takes nextPageToken instead of offset and reports no total. Pass each response's nextPageToken to get the next page, until isLast is true.
Query Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
search | string | Text in the issue titles or descriptions, or an identifier (up to 255 characters). | No filter | search=login |
nextPageToken | string | nextPageToken of the previous page. | First page | nextPageToken=a1b2… |
limit | number | Maximum number of items to return. Accepted range: 1–250. | 20 | limit=50 |
Response
Status: 200 OK
{
data: LinearIssue[] // See Linear Issue Object
nextPageToken: string | null // Token for the next page, null on the last page
isLast: boolean // Whether this is the last page
}Create Linear Issue
Creates an issue in the linked team, as the integration's Linear account.
Request Body
Send JSON, or multipart/form-data to attach files.
{
summary: string // Title (1–255 characters)
description?: string // Description in Markdown (up to 32,767 characters)
}With multipart/form-data, up to 5 files go in attachments fields (100 MiB each, 250 MiB in all). Linear stores them, and the description gets links to them.
Response
Status: 201 Created
{
id: string // Linear issue ID
identifier: string // Issue identifier (e.g. `ENG-34`)
url: string // URL of the issue in Linear
}